diff --git a/app/ui/main_helper.py b/app/ui/main_helper.py index a2c13de4..b414bf3d 100644 --- a/app/ui/main_helper.py +++ b/app/ui/main_helper.py @@ -75,6 +75,9 @@ def move_items(key, view: Gtk.TreeView): if parent_paths: paths = parent_paths min_path = model.get_path(model.get_iter_first()) + view.collapse_all() + if mod_length == len(paths): + return else: if not is_some_level(paths): return @@ -87,9 +90,6 @@ def move_items(key, view: Gtk.TreeView): max_path = Gtk.TreePath.new_from_string("{}:{}".format(parent_index, children_num)) is_tree_store = True - if mod_length == len(paths): - return - if key == Gdk.KEY_Up: top_path = Gtk.TreePath(paths[0]) top_path.prev() diff --git a/app/ui/satellites_dialog.py b/app/ui/satellites_dialog.py index cccb70c8..61596337 100644 --- a/app/ui/satellites_dialog.py +++ b/app/ui/satellites_dialog.py @@ -3,7 +3,7 @@ from math import fabs from app.commons import run_idle from app.eparser import get_satellites, write_satellites, Satellite, Transponder -from .uicommons import Gtk, Gdk, UI_RESOURCES_PATH, TEXT_DOMAIN +from .uicommons import Gtk, Gdk, UI_RESOURCES_PATH, TEXT_DOMAIN, MOVE_KEYS from .dialogs import show_dialog, DialogType, WaitDialog from .main_helper import move_items, scroll_to @@ -125,7 +125,7 @@ class SatellitesDialog: self.on_transponder() elif key == Gdk.KEY_space: pass - elif ctrl and key in _MOVE_KEYS: + elif ctrl and key in MOVE_KEYS: move_items(key, self._sat_view) elif key == Gdk.KEY_Left or key == Gdk.KEY_Right: view.do_unselect_all(view)