diff --git a/src/versions/solarfm-0.0.1/SolarFM/new/solarfm/signal_classes/KeyboardSignalsMixin.py b/src/versions/solarfm-0.0.1/SolarFM/new/solarfm/signal_classes/KeyboardSignalsMixin.py index eb109b0..2974d51 100644 --- a/src/versions/solarfm-0.0.1/SolarFM/new/solarfm/signal_classes/KeyboardSignalsMixin.py +++ b/src/versions/solarfm-0.0.1/SolarFM/new/solarfm/signal_classes/KeyboardSignalsMixin.py @@ -10,7 +10,7 @@ from gi.repository import Gtk, Gdk # Application imports -valid_fname_pat = re.compile(r"[a-z0-9A-Z-_\[\]\(\)\| ]") +valid_keyvalue_pat = re.compile(r"[a-z0-9A-Z-_\[\]\(\)\| ]") class KeyboardSignalsMixin: @@ -44,10 +44,11 @@ class KeyboardSignalsMixin: self.trash_files() - if re.fullmatch(valid_fname_pat, keyname): - if not self.ctrlDown and not self.shiftDown and not self.altDown: - focused_obj = self.window.get_focus() - if not self.is_searching and isinstance(focused_obj, Gtk.IconView): + if re.fullmatch(valid_keyvalue_pat, keyname): + if not self.is_searching and not self.ctrlDown \ + and not self.shiftDown and not self.altDown: + focused_obj = self.window.get_focus() + if isinstance(focused_obj, Gtk.IconView): self.is_searching = True wid, tid, self.search_view, self.search_iconview, store = self.get_current_state() self.popup_search_files(wid, keyname) diff --git a/src/versions/solarfm-0.0.1/SolarFM/new/solarfm/signal_classes/mixins/WidgetFileActionMixin.py b/src/versions/solarfm-0.0.1/SolarFM/new/solarfm/signal_classes/mixins/WidgetFileActionMixin.py index 01ce62d..84bb949 100644 --- a/src/versions/solarfm-0.0.1/SolarFM/new/solarfm/signal_classes/mixins/WidgetFileActionMixin.py +++ b/src/versions/solarfm-0.0.1/SolarFM/new/solarfm/signal_classes/mixins/WidgetFileActionMixin.py @@ -69,6 +69,11 @@ class WidgetFileActionMixin: path = Gtk.TreePath().new_from_indices([i]) self.search_iconview.select_path(path) + items = self.search_iconview.get_selected_items() + if len(items) == 1: + self.search_iconview.scroll_to_path(items[0], True, 0.5, 0.5) + + def open_files(self): wid, tid, view, iconview, store = self.get_current_state() uris = self.format_to_uris(store, wid, tid, self.selected_files, True)