Philipp Hörist pushed to branch master at gajim / gajim


Commits:
f7cae73e by lovetox at 2022-06-05T01:47:51+02:00
feat: Add `Minimize to Tray` preference setting

NOTES:
The ACE setting `main_window_skip_taskbar` is replaced with the
preference setting `Minimize to Tray` without migration.

- - - - -
f8ea8b87 by lovetox at 2022-06-05T01:49:59+02:00
chore: Add NOTES section to ChangeLog

- - - - -


5 changed files:

- .chglog/config.yml
- gajim/common/setting_values.py
- gajim/gtk/main.py
- gajim/gtk/preferences.py
- gajim/gtk/status_icon.py


Changes:

=====================================
.chglog/config.yml
=====================================
@@ -34,3 +34,6 @@ options:
   refs:
     actions:
       - Fixes
+  notes:
+    keywords:
+      - NOTES


=====================================
gajim/common/setting_values.py
=====================================
@@ -66,7 +66,7 @@ class _ACCOUNT_DEFAULT:
     'ignore_incoming_attention',
     'last_main_window_visible',
     'log_contact_status_changes',
-    'main_window_skip_taskbar',
+    'minimize_to_tray',
     'muc_prefer_direct_msg',
     'notification_preview_message',
     'notify_on_all_muc_messages',
@@ -207,7 +207,7 @@ class _ACCOUNT_DEFAULT:
     'last_main_window_visible': True,
     'quit_on_main_window_x_button': False,
     'hide_on_main_window_x_button': False,
-    'main_window_skip_taskbar': False,
+    'minimize_to_tray': False,
     'latest_disco_addresses': '',
     'change_roster_title': True,
     'restore_timeout': -1,
@@ -645,7 +645,6 @@ class WorkspaceSettings(TypedDict):
         'notification_preview_message': _('Preview new messages in 
notification popup?'),
         'muc_highlight_words': _('A list of words (semicolon separated) that 
will be highlighted in group chats.'),
         'hide_on_main_window_x_button': _('If enabled, Gajim hides the main 
window when pressing the X button instead of minimizing into the notification 
area.'),
-        'main_window_skip_taskbar': _('Don’t show main window in the system 
taskbar.'),
         'use_urgency_hint': _('If enabled, Gajim makes the window flash (the 
default behaviour in most Window Managers) when holding pending events.'),
         'notification_timeout': '',
         'escape_key_closes': _('If enabled, pressing Esc closes a 
tab/window.'),


=====================================
gajim/gtk/main.py
=====================================
@@ -156,8 +156,8 @@ def __init__(self) -> None:
                                   self._on_client_state_changed)
 
     def _prepare_window(self) -> None:
-        if app.settings.get('main_window_skip_taskbar'):
-            self.set_property('skip-taskbar-hint', True)
+        if app.settings.get('minimize_to_tray'):
+            self.set_skip_taskbar_hint(True)
 
         restore_main_window_position()
         window_width = app.settings.get('mainwin_width')


=====================================
gajim/gtk/preferences.py
=====================================
@@ -204,10 +204,21 @@ def __init__(self, *args: Any) -> None:
                     SettingType.CONFIG,
                     'quit_on_main_window_x_button',
                     desc=_('Quit when closing Gajim’s window')),
+
+            Setting(SettingKind.SWITCH,
+                    _('Minimize to Tray'),
+                    SettingType.CONFIG,
+                    'minimize_to_tray',
+                    desc=_('Hide window to system tray when minimized'),
+                    callback=self._on__minimize_to_tray),
         ]
 
         PreferenceBox.__init__(self, settings)
 
+    @staticmethod
+    def _on__minimize_to_tray(value: bool, *args: Any) -> None:
+        app.window.set_skip_taskbar_hint(value)
+
 
 class Plugins(PreferenceBox):
     def __init__(self, *args: Any) -> None:


=====================================
gajim/gtk/status_icon.py
=====================================
@@ -200,8 +200,6 @@ def _on_activate(self, *args: Any) -> None:
             # Window was minimized
             restore_main_window_position()
 
-        if not app.settings.get('main_window_skip_taskbar'):
-            app.window.set_property('skip-taskbar-hint', False)
         app.window.present_with_time(Gtk.get_current_event_time())
 
     @staticmethod



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/2c54d9e674f1ffd4f00bea1e8c1419b2136887aa...f8ea8b8715acff086663770c51aa18e11077db0a

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/2c54d9e674f1ffd4f00bea1e8c1419b2136887aa...f8ea8b8715acff086663770c51aa18e11077db0a
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to