Skip to content

Commit c6768d3

Browse files
committed
feat: Add button to clear urchin API key
I'm struggling with keyboard input on mac and linux - hence the paste button. With the addition of the invalid key warning we also need a nice way for these users to be able to remove their API key.
1 parent deec9ea commit c6768d3

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

src/prism/overlay/output/overlay/settings_page.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,24 @@ def __init__(self, parent: "SettingsPage") -> None:
243243
)
244244
paste_button.grid(row=1, column=3, padx=(5, 0))
245245

246+
clear_button = tk.Button(
247+
self.frame,
248+
text="X",
249+
font=("Consolas", 10),
250+
foreground="red",
251+
background="black",
252+
command=lambda: self.urchin_api_key_variable.set(""),
253+
relief="flat",
254+
cursor="hand2",
255+
)
256+
clear_button.grid(row=1, column=4, padx=(5, 0))
257+
246258
parent.make_widgets_scrollable(
247-
api_key_label, self.urchin_api_key_entry, show_button, paste_button
259+
api_key_label,
260+
self.urchin_api_key_entry,
261+
show_button,
262+
paste_button,
263+
clear_button,
248264
)
249265

250266
def _paste_from_clipboard(self) -> None:

0 commit comments

Comments
 (0)