Skip to content

Commit

Permalink
Add close with escape key for popular remotes
Browse files Browse the repository at this point in the history
  • Loading branch information
heliguy4599 committed Oct 4, 2023
1 parent 3d692e7 commit c82ee4d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/popular_remotes_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ class PopularRemotesWindow(Adw.Window):
["kdeapps", "https://distribute.kde.org/kdeapps.flatpakrepo", _("Beta KDE Apps and Runtimes")],
]

def key_handler(self, _a, event, _c, _d):
if event == Gdk.KEY_Escape:
self.close()

def on_add_response(self, _dialog, response_id, _function):
if response_id == "cancel":
return
Expand Down Expand Up @@ -175,6 +179,9 @@ def __init__(self, parent_window, **kwargs):
self.my_utils = myUtils(self)
self.parent_window = parent_window
self.set_size_request(260, 230)
event_controller = Gtk.EventControllerKey()
event_controller.connect("key-pressed", self.key_handler)
self.add_controller(event_controller)

self.new_env = dict( os.environ )
self.new_env['LC_ALL'] = 'C'
Expand Down

0 comments on commit c82ee4d

Please sign in to comment.