From 3756f99cdc2cc2ab5d00d5d2609fb0d90fa3b3e9 Mon Sep 17 00:00:00 2001 From: RomainFT Date: Sun, 1 Jan 2023 02:23:05 +0100 Subject: [PATCH] Selection optionsbar: show copy/cut/del instead of import/paste (mobile) the familiarity with icons makes much sense this way + show the "selection options" label to avoid confusion between the 2 menus (desktop) --- .../selection/optionsbar-selection.ui | 162 ++++++++---------- .../selection/optionsbar_selection.py | 20 ++- 2 files changed, 87 insertions(+), 95 deletions(-) diff --git a/src/optionsbars/selection/optionsbar-selection.ui b/src/optionsbars/selection/optionsbar-selection.ui index 8cc76e53..450fbf70 100644 --- a/src/optionsbars/selection/optionsbar-selection.ui +++ b/src/optionsbars/selection/optionsbar-selection.ui @@ -6,82 +6,66 @@ True - + True win.import - Import + Import True - - - insert-image-symbolic - True - - win.paste - Paste + Paste True - - - edit-paste-symbolic - True - - + + + + + True + - + + win.selection_delete + Delete True - - actions-menu-long - + + edit-delete-symbolic True - 10 - - - system-run-symbolic - True - - - - - pan-down-symbolic - True - - - end - - - - - - - - True - - win.import - Import + win.selection_cut + Cut True + + + edit-cut-symbolic + True + + - win.paste - Paste + win.selection_copy + Copy True + + + edit-copy-symbolic + True + + @@ -116,45 +100,28 @@ - + True - - - - win.selection_delete - Delete - True - - - edit-delete-symbolic - True - - - - + + actions-menu-long - - win.selection_cut - Cut + True + 10 - edit-cut-symbolic + system-run-symbolic True - - - - - win.selection_copy - Copy - True - edit-copy-symbolic + pan-down-symbolic True + + end + @@ -163,13 +130,41 @@ + center True options-menu - Selection options - - view-more-symbolic + True + 10 + + + True + 10 + + + Selection options + True + + + + + pan-down-symbolic + True + + + end + + + + + + + view-more-symbolic + Selection options + True + + @@ -253,19 +248,12 @@
horizontal-buttons - Delete - win.selection_delete - edit-delete-symbolic - - - Cut - win.selection_cut - edit-cut-symbolic + Import + win.import - Copy - win.selection_copy - edit-copy-symbolic + Paste + win.paste
diff --git a/src/optionsbars/selection/optionsbar_selection.py b/src/optionsbars/selection/optionsbar_selection.py index 04e96804..14955ce1 100644 --- a/src/optionsbars/selection/optionsbar_selection.py +++ b/src/optionsbars/selection/optionsbar_selection.py @@ -25,14 +25,15 @@ def __init__(self, window): self.window = window builder = self._build_ui('selection/optionsbar-selection.ui') - self.import_box_narrow = builder.get_object('import_box_narrow') - self.import_box_long = builder.get_object('import_box_long') + self.import_box = builder.get_object('import_box') self.clipboard_box = builder.get_object('clipboard_box') - self.actions_btn = builder.get_object('actions_btn') self.actions_btn_long = builder.get_object('actions_btn_long') self._togglable_btn = self.actions_btn + self.options_long_box = builder.get_object('options_long_box') + self.options_short_box = builder.get_object('options_short_box') + self.minimap_btn = builder.get_object('minimap_btn') self.minimap_label = builder.get_object('minimap_label') self.minimap_arrow = builder.get_object('minimap_arrow') @@ -50,24 +51,27 @@ def middle_click_action(self): def init_adaptability(self): super().init_adaptability() - temp_limit_size = self.import_box_long.get_preferred_width()[0] + \ + temp_limit_size = self.import_box.get_preferred_width()[0] + \ self.clipboard_box.get_preferred_width()[0] + \ self.actions_btn.get_preferred_width()[0] + \ - self.options_btn.get_preferred_width()[0] + \ + self.options_long_box.get_preferred_width()[0] + \ self.help_btn.get_preferred_width()[0] + \ self.minimap_btn.get_preferred_width()[0] self._set_limit_size(temp_limit_size) def set_compact(self, state): super().set_compact(state) - self.import_box_narrow.set_visible(state) - self.import_box_long.set_visible(not state) + self.actions_btn_long.set_visible(state) + self.import_box.set_visible(not state) self.actions_btn.set_visible(not state) - self.clipboard_box.set_visible(not state) + + self.options_long_box.set_visible(not state) + self.options_short_box.set_visible(state) if state: self._togglable_btn = self.actions_btn_long else: self._togglable_btn = self.actions_btn + self.minimap_arrow.set_visible(not state) ############################################################################