Daniel Brötzmann pushed to branch master at gajim / gajim


Commits:
80112fed by wurstsalat at 2022-05-23T15:09:54+02:00
imprv: Preferences: Bind show_send_message_button to send_on_ctrl_enter

This way, users can press Enter to insert a new line, then click Send 
(user-friendly)

Fixes: #10671

- - - - -


1 changed file:

- gajim/gtk/preferences.py


Changes:

=====================================
gajim/gtk/preferences.py
=====================================
@@ -270,7 +270,8 @@ def __init__(self, *args: Any) -> None:
             Setting(SettingKind.SWITCH,
                     _('Show Send Message Button'),
                     SettingType.CONFIG,
-                    'show_send_message_button'),
+                    'show_send_message_button',
+                    callback=self._on_show_send_message_button),
 
             Setting(SettingKind.SWITCH,
                     _('Show Status Changes'),
@@ -307,6 +308,12 @@ def _on_use_speller(value: bool, *args: Any) -> None:
         for ctrl in app.window.get_controls():
             ctrl.set_speller()
 
+    @staticmethod
+    def _on_show_send_message_button(show_button: bool, *args: Any) -> None:
+        # Bind to send_on_ctrl_enter to make this setting user-friendly
+        # This way, users can press Enter to insert a new line, then click Send
+        app.settings.set('send_on_ctrl_enter', show_button)
+
 
 class GroupChats(PreferenceBox):
     def __init__(self, *args: Any) -> None:



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/80112fedddb833fb9559c5fc29b175e21bbcc242

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/80112fedddb833fb9559c5fc29b175e21bbcc242
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