Daniel Brötzmann pushed to branch mainwindow at gajim / gajim
Commits: b0958ff7 by wurstsalat at 2021-05-02T13:15:58+02:00 WorkspaceSidebar: Improve add button
- - - - -
2 changed files:
- gajim/data/style/gajim.css - gajim/gtk/workspace_side_bar.py
Changes:
===================================== gajim/data/style/gajim.css ===================================== @@ -171,18 +171,14 @@ .workspace-sidebar-item.drag-hover-bottom { border-bottom: 1px solid #4e9a06; } -.workspace-add { - padding: 0 0 0 6px; - margin: 6px 12px; -} -.workspace-add image { - margin: 0px; - padding: 0px; - color: alpha(@theme_text_color, 0.7); - background-color: shade(@theme_base_color, 0.9); +.workspace-add:hover, +.workspace-add:focus { + background: transparent; + box-shadow: none; + outline: none; } -.workspace-add:hover image { - background-color: shade(@theme_base_color, 0.85); +.workspace-add button { + margin: 6px 8px 6px 14px; }
/* Account sidebar */
===================================== gajim/gtk/workspace_side_bar.py ===================================== @@ -206,14 +206,13 @@ def update_avatar(self, workspace_id): class CommonWorkspace(Gtk.ListBoxRow): def __init__(self, workspace_id): Gtk.ListBoxRow.__init__(self) - self.get_style_context().add_class('workspace-sidebar-item') - self.workspace_id = workspace_id
class Workspace(CommonWorkspace): def __init__(self, workspace_id): CommonWorkspace.__init__(self, workspace_id) + self.get_style_context().add_class('workspace-sidebar-item')
self._unread_label = Gtk.Label() self._unread_label.get_style_context().add_class( @@ -286,12 +285,16 @@ def __init__(self, workspace_id): self.set_selectable(False) self.set_tooltip_text(_('Add Workspace')) self.get_style_context().add_class('workspace-add') - - image = Gtk.Image.new_from_icon_name('list-add-symbolic', - Gtk.IconSize.DND) - self.add(image) + button = Gtk.Button.new_from_icon_name('list-add-symbolic', + Gtk.IconSize.BUTTON) + button.connect('clicked', self._on_add_clicked) + self.add(button) self.show_all()
+ @staticmethod + def _on_add_clicked(_button): + open_window('WorkspaceDialog') +
class WorkspaceAvatar(Gtk.Image): def __init__(self, workspace_id):
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/b0958ff7f50cb1f7c99c96319e75a09be...