Fixed a bug in the run dialogue script.

This commit is contained in:
Storm Dragon
2026-06-12 12:03:36 -04:00
parent eac601d5b2
commit 65a03eb441
+7 -5
View File
@@ -314,7 +314,7 @@ class RunDialog(Gtk.Window):
window_accessible.set_name(APP_NAME)
window_accessible.set_description(
"Type to find commands and applications. Type a path to browse files. "
"Use up and down arrows to select a result, Tab to insert a result, "
"Use up and down arrows to select a result, Tab to insert the selected result, "
"and Enter to open it."
)
self.entry.get_accessible().set_name("Command, application, or file")
@@ -341,8 +341,7 @@ class RunDialog(Gtk.Window):
for result in self.results:
self.store.append((result.label, result.detail))
if self.results:
self.view.get_selection().select_path(0)
self.view.get_selection().unselect_all()
self.schedule_result_feedback(len(self.results))
def set_status(self, message):
@@ -509,8 +508,11 @@ class RunDialog(Gtk.Window):
def on_entry_key_press(self, _entry, event):
if event.keyval in (Gdk.KEY_Down, Gdk.KEY_Up):
self.view.grab_focus()
if event.keyval == Gdk.KEY_Up and self.results:
self.view.get_selection().select_path(len(self.results) - 1)
if self.results:
if event.keyval == Gdk.KEY_Up:
self.view.get_selection().select_path(len(self.results) - 1)
else:
self.view.get_selection().select_path(0)
return True
if event.keyval == Gdk.KEY_Tab:
self.insert_selected_result()