Improve dialog UX: enable Enter key activation for all input dialogs
This commit is contained in:
parent
4c28020269
commit
97196f2e14
@ -96,6 +96,7 @@ class EnvironmentsDialog(Adw.Dialog):
|
||||
|
||||
entry = Gtk.Entry()
|
||||
entry.set_placeholder_text("Variable name")
|
||||
entry.set_activates_default(True)
|
||||
dialog.set_extra_child(entry)
|
||||
|
||||
dialog.add_response("cancel", "Cancel")
|
||||
@ -156,6 +157,7 @@ class EnvironmentsDialog(Adw.Dialog):
|
||||
|
||||
entry = Gtk.Entry()
|
||||
entry.set_placeholder_text("Environment name (e.g., Production)")
|
||||
entry.set_activates_default(True)
|
||||
dialog.set_extra_child(entry)
|
||||
|
||||
dialog.add_response("cancel", "Cancel")
|
||||
@ -184,11 +186,14 @@ class EnvironmentsDialog(Adw.Dialog):
|
||||
|
||||
entry = Gtk.Entry()
|
||||
entry.set_text(environment.name)
|
||||
entry.set_activates_default(True)
|
||||
dialog.set_extra_child(entry)
|
||||
|
||||
dialog.add_response("cancel", "Cancel")
|
||||
dialog.add_response("save", "Save")
|
||||
dialog.set_response_appearance("save", Adw.ResponseAppearance.SUGGESTED)
|
||||
dialog.set_default_response("save")
|
||||
dialog.set_close_response("cancel")
|
||||
|
||||
def on_response(dlg, response):
|
||||
if response == "save":
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user