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


Commits:
48c2d877 by wurstsalat at 2021-02-20T19:29:55+01:00
ChatList: Add placeholder

- - - - -


2 changed files:

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


Changes:

=====================================
gajim/data/style/gajim.css
=====================================
@@ -142,6 +142,16 @@
        padding: 12px;
        background: transparent;
 }
+.chatlist-placeholder {
+    padding: 24px 12px;
+}
+.chatlist-placeholder image {
+    color: alpha(@theme_text_color, 0.3);
+}
+.chatlist-placeholder label {
+    color: alpha(@theme_text_color, 0.5);
+    font-weight: bold;
+}
 .chatlist {
     background: transparent;
 }


=====================================
gajim/gtk/chat_list.py
=====================================
@@ -33,6 +33,7 @@ def __init__(self, workspace_id):
         self.set_header_func(self._header_func)
         self.set_sort_func(self._sort_func)
         self.set_has_tooltip(True)
+        self._set_placeholder()
 
         self.connect('destroy', self._on_destroy)
         self.connect('query-tooltip', self._query_tooltip)
@@ -134,6 +135,20 @@ def _sort_func(row1, row2):
             return 0
         return -1 if row1.is_recent else 1
 
+    def _set_placeholder(self):
+        icon = Gtk.Image.new_from_icon_name(
+            'go-up-symbolic', Gtk.IconSize.DND)
+        icon.set_halign(Gtk.Align.END)
+        label = Gtk.Label(label=_('Add a chat to get started'))
+        label.set_line_wrap(True)
+        label.set_max_width_chars(20)
+        box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=18)
+        box.get_style_context().add_class('chatlist-placeholder')
+        box.add(icon)
+        box.add(label)
+        box.show_all()
+        self.set_placeholder(box)
+
     def set_filter_text(self, text):
         self._current_filter_text = text
         self.invalidate_filter()



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/48c2d8776b22ea9f755a20ef2f04af10ad1a3212

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