mirror of
https://github.com/DYefremov/DemonEditor.git
synced 2025-12-22 00:19:40 +01:00
small changes of moving from keyboard
This commit is contained in:
@@ -73,8 +73,6 @@ class Application(Gtk.Application):
|
|||||||
"on_bouquets_selection": self.on_bouquets_selection,
|
"on_bouquets_selection": self.on_bouquets_selection,
|
||||||
"on_satellite_editor_show": self.on_satellite_editor_show,
|
"on_satellite_editor_show": self.on_satellite_editor_show,
|
||||||
"on_services_selection": self.on_services_selection,
|
"on_services_selection": self.on_services_selection,
|
||||||
"on_up": self.on_up,
|
|
||||||
"on_down": self.on_down,
|
|
||||||
"on_fav_cut": self.on_fav_cut,
|
"on_fav_cut": self.on_fav_cut,
|
||||||
"on_bouquets_cut": self.on_bouquets_cut,
|
"on_bouquets_cut": self.on_bouquets_cut,
|
||||||
"on_services_copy": self.on_services_copy,
|
"on_services_copy": self.on_services_copy,
|
||||||
@@ -328,12 +326,6 @@ class Application(Gtk.Application):
|
|||||||
""" Stores new size properties for app window after resize """
|
""" Stores new size properties for app window after resize """
|
||||||
self._options["window_size"] = window.get_size()
|
self._options["window_size"] = window.get_size()
|
||||||
|
|
||||||
def on_up(self, item):
|
|
||||||
self.move_items(Gdk.KEY_Up)
|
|
||||||
|
|
||||||
def on_down(self, item):
|
|
||||||
self.move_items(Gdk.KEY_Down)
|
|
||||||
|
|
||||||
@run_idle
|
@run_idle
|
||||||
def on_about_app(self, item):
|
def on_about_app(self, item):
|
||||||
show_dialog(DialogType.ABOUT, self._main_window)
|
show_dialog(DialogType.ABOUT, self._main_window)
|
||||||
@@ -1043,11 +1035,14 @@ class Application(Gtk.Application):
|
|||||||
key_code = event.hardware_keycode
|
key_code = event.hardware_keycode
|
||||||
if not KeyboardKey.value_exist(key_code):
|
if not KeyboardKey.value_exist(key_code):
|
||||||
return
|
return
|
||||||
|
|
||||||
key = KeyboardKey(key_code)
|
key = KeyboardKey(key_code)
|
||||||
ctrl = event.state & Gdk.ModifierType.CONTROL_MASK
|
ctrl = event.state & Gdk.ModifierType.CONTROL_MASK
|
||||||
model_name, model = get_model_data(view)
|
model_name, model = get_model_data(view)
|
||||||
|
|
||||||
if ctrl and key is KeyboardKey.C:
|
if ctrl and key in MOVE_KEYS:
|
||||||
|
self.move_items(key)
|
||||||
|
elif ctrl and key is KeyboardKey.C:
|
||||||
if model_name == self._SERVICE_LIST_NAME:
|
if model_name == self._SERVICE_LIST_NAME:
|
||||||
self.on_copy(view, ViewTarget.FAV)
|
self.on_copy(view, ViewTarget.FAV)
|
||||||
elif model_name == self._FAV_LIST_NAME:
|
elif model_name == self._FAV_LIST_NAME:
|
||||||
@@ -1072,14 +1067,12 @@ class Application(Gtk.Application):
|
|||||||
key_code = event.hardware_keycode
|
key_code = event.hardware_keycode
|
||||||
if not KeyboardKey.value_exist(key_code):
|
if not KeyboardKey.value_exist(key_code):
|
||||||
return
|
return
|
||||||
|
|
||||||
key = KeyboardKey(key_code)
|
key = KeyboardKey(key_code)
|
||||||
ctrl = event.state & Gdk.ModifierType.CONTROL_MASK
|
ctrl = event.state & Gdk.ModifierType.CONTROL_MASK
|
||||||
alt = event.state & Gdk.ModifierType.MOD1_MASK
|
|
||||||
model_name, model = get_model_data(view)
|
model_name, model = get_model_data(view)
|
||||||
|
|
||||||
if ctrl and key in MOVE_KEYS:
|
if ctrl and key is KeyboardKey.INSERT:
|
||||||
self.move_items(key)
|
|
||||||
elif ctrl and key is KeyboardKey.INSERT:
|
|
||||||
# Move items from app to fav list
|
# Move items from app to fav list
|
||||||
if model_name == self._SERVICE_LIST_NAME:
|
if model_name == self._SERVICE_LIST_NAME:
|
||||||
self.on_to_fav_copy(view)
|
self.on_to_fav_copy(view)
|
||||||
|
|||||||
Reference in New Issue
Block a user