Fixed a bug in the run dialogue script.
This commit is contained in:
@@ -314,7 +314,7 @@ class RunDialog(Gtk.Window):
|
|||||||
window_accessible.set_name(APP_NAME)
|
window_accessible.set_name(APP_NAME)
|
||||||
window_accessible.set_description(
|
window_accessible.set_description(
|
||||||
"Type to find commands and applications. Type a path to browse files. "
|
"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."
|
"and Enter to open it."
|
||||||
)
|
)
|
||||||
self.entry.get_accessible().set_name("Command, application, or file")
|
self.entry.get_accessible().set_name("Command, application, or file")
|
||||||
@@ -341,8 +341,7 @@ class RunDialog(Gtk.Window):
|
|||||||
for result in self.results:
|
for result in self.results:
|
||||||
self.store.append((result.label, result.detail))
|
self.store.append((result.label, result.detail))
|
||||||
|
|
||||||
if self.results:
|
self.view.get_selection().unselect_all()
|
||||||
self.view.get_selection().select_path(0)
|
|
||||||
self.schedule_result_feedback(len(self.results))
|
self.schedule_result_feedback(len(self.results))
|
||||||
|
|
||||||
def set_status(self, message):
|
def set_status(self, message):
|
||||||
@@ -509,8 +508,11 @@ class RunDialog(Gtk.Window):
|
|||||||
def on_entry_key_press(self, _entry, event):
|
def on_entry_key_press(self, _entry, event):
|
||||||
if event.keyval in (Gdk.KEY_Down, Gdk.KEY_Up):
|
if event.keyval in (Gdk.KEY_Down, Gdk.KEY_Up):
|
||||||
self.view.grab_focus()
|
self.view.grab_focus()
|
||||||
if event.keyval == Gdk.KEY_Up and self.results:
|
if self.results:
|
||||||
|
if event.keyval == Gdk.KEY_Up:
|
||||||
self.view.get_selection().select_path(len(self.results) - 1)
|
self.view.get_selection().select_path(len(self.results) - 1)
|
||||||
|
else:
|
||||||
|
self.view.get_selection().select_path(0)
|
||||||
return True
|
return True
|
||||||
if event.keyval == Gdk.KEY_Tab:
|
if event.keyval == Gdk.KEY_Tab:
|
||||||
self.insert_selected_result()
|
self.insert_selected_result()
|
||||||
|
|||||||
Reference in New Issue
Block a user