From 246cea28fdb6f8d8c39029a84aae4a88b10a7db0 Mon Sep 17 00:00:00 2001 From: wurstsalat <mailtrash@posteo.de> Date: Sun, 2 May 2021 13:15:58 +0200 Subject: [PATCH] WorkspaceSidebar: Improve add button --- gajim/data/style/gajim.css | 18 +++++++----------- gajim/gtk/workspace_side_bar.py | 15 +++++++++------ 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/gajim/data/style/gajim.css b/gajim/data/style/gajim.css index bceeae047e..888b2d51b9 100644 --- a/gajim/data/style/gajim.css +++ b/gajim/data/style/gajim.css @@ -171,18 +171,14 @@ .workspace-sidebar-item.drag-hover-top { .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 */ diff --git a/gajim/gtk/workspace_side_bar.py b/gajim/gtk/workspace_side_bar.py index 377348a3c6..bad3cf2d97 100644 --- a/gajim/gtk/workspace_side_bar.py +++ b/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): -- GitLab