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


Commits:
b03d8465 by wurstsalat at 2022-06-14T18:16:48+02:00
imprv: Chat commands: Better font readability

- - - - -
9b412938 by wurstsalat at 2022-06-14T18:16:48+02:00
fix: ChatActionProcessor: Fix iterating commands for popover

- - - - -


2 changed files:

- gajim/data/style/gajim.css
- gajim/gtk/chat_action_processor.py


Changes:

=====================================
gajim/data/style/gajim.css
=====================================
@@ -80,9 +80,9 @@ .conversation-date-row {
     padding: 12px;
 }
 .conversation-command-row label {
+    font-weight: 600;
     border-radius: 6px;
     padding: 12px;
-    font-size: small;
 }
 .conversation-subject-box,
 .conversation-call-box {


=====================================
gajim/gtk/chat_action_processor.py
=====================================
@@ -74,13 +74,11 @@ def _on_key_press(self,
             self._move_selection(Direction.NEXT)
             return True
 
-        if event.keyval == Gdk.KEY_Return:
-            selected_action = self._get_selected_action()
-            self._replace_text(selected_action)
+        if event.keyval in (Gdk.KEY_Left, Gdk.KEY_Right):
             self.popdown()
-            return True
+            return False
 
-        if event.keyval == Gdk.KEY_Tab:
+        if event.keyval in (Gdk.KEY_Return, Gdk.KEY_Tab):
             selected_action = self._get_selected_action()
             self._replace_text(selected_action)
             self.popdown()
@@ -160,16 +158,19 @@ def _update_commands_menu(self,
                               ) -> None:
         self._menu.remove_all()
         command_list = self._get_commands()
+        num_entries = 0
         for command in command_list:
             if not command.startswith(action_text[1:]):
                 continue
-            if command_list.index(command) >= MAX_ENTRIES:
+            if num_entries >= MAX_ENTRIES:
                 continue
+
             action_data = GLib.Variant('s', f'/{command}')
             menu_item = Gio.MenuItem()
             menu_item.set_label(f'/{command}')
             menu_item.set_attribute_value('action-data', action_data)
             self._menu.append_item(menu_item)
+            num_entries +=1
 
         if self._menu.get_n_items() > 0:
             self._show_menu(start)



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/a3d0a0ba4e8c13b20a4d85bd77a307a0f63cf843...9b41293892a582adbd514ccdba30372a8fa3e163

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/a3d0a0ba4e8c13b20a4d85bd77a307a0f63cf843...9b41293892a582adbd514ccdba30372a8fa3e163
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