little fix for move in tree model

This commit is contained in:
Dmitriy Yefremov
2018-04-16 19:42:48 +03:00
parent 18caa58336
commit b310b640b4
2 changed files with 5 additions and 5 deletions

View File

@@ -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()

View File

@@ -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)