Daniel Brötzmann pushed to branch mainwindow at gajim / gajim
Commits:
fb7c6c6f by wurstsalat at 2021-02-20T14:03:37+01:00
WorkspaceSidebar: Improve item highlighting
- - - - -
2 changed files:
- gajim/data/style/gajim.css
- gajim/gtk/workspace_side_bar.py
Changes:
=====================================
gajim/data/style/gajim.css
=====================================
@@ -43,6 +43,12 @@
border-top-right-radius: 6px;
border-bottom-right-radius: 6px;
}
+.selection-bar {
+ border-top-right-radius: 6px;
+ border-bottom-right-radius: 6px;
+ margin-top: 6px;
+ margin-bottom: 6px;
+}
.small-label {
font-size: small;
}
@@ -61,7 +67,6 @@
/* Workspace sidebar */
.workspace-sidebar {
background: transparent;
- margin-left: 6px;
margin-right: 6px;
}
.workspace-sidebar-item {
@@ -69,14 +74,17 @@
padding-bottom: 0px;
}
.workspace-sidebar-item:selected,
-.workspace-sidebar-item:hover {
+.workspace-sidebar-item:hover,
+.workspace-sidebar-item:focus {
background: transparent;
box-shadow: none;
outline: none;
}
-.workspace-sidebar-item:selected image,
-.workspace-sidebar-item:hover image {
- box-shadow: 0 0 6px @theme_selected_bg_color;
+.workspace-sidebar-item:selected .selection-bar {
+ background-color: lighter(@theme_selected_bg_color);
+}
+.workspace-sidebar-item:hover .selection-bar {
+ background-color: @theme_selected_bg_color;
}
.workspace-sidebar-item image {
border-radius: 9px;
@@ -88,6 +96,13 @@
.workspace-sidebar-item.drag-hover-bottom {
border-bottom: 1px solid #4e9a06;
}
+.workspace-add {
+ padding-left: 6px;
+ color: alpha(@theme_text_color, 0.7);
+}
+.workspace-sidebar-item:hover .workspace-add {
+ -gtk-icon-shadow: 0 0 3px @theme_selected_bg_color;
+}
/* Account sidebar */
.account-sidebar {
=====================================
gajim/gtk/workspace_side_bar.py
=====================================
@@ -1,7 +1,6 @@
from gi.repository import Gdk
from gi.repository import Gtk
-from gi.repository import GLib
from gajim.common import app
from gajim.common.const import AvatarSize
@@ -206,8 +205,16 @@ def __init__(self, workspace_id):
self._image = WorkspaceAvatar(workspace_id)
self._image.set_halign(Gtk.Align.CENTER)
+ selection_bar = Gtk.Box()
+ selection_bar.set_size_request(6, -1)
+ selection_bar.get_style_context().add_class('selection-bar')
+
+ item_box = Gtk.Box()
+ item_box.add(selection_bar)
+ item_box.add(self._image)
+
overlay = Gtk.Overlay()
- overlay.add(self._image)
+ overlay.add(item_box)
overlay.add_overlay(self._unread_label)
# Drag and Drop
@@ -257,11 +264,12 @@ class AddWorkspace(CommonWorkspace):
def __init__(self, workspace_id):
CommonWorkspace.__init__(self, workspace_id)
self.set_selectable(False)
+ self.set_tooltip_text(_('Add Workspace'))
image = Gtk.Image.new_from_icon_name('list-add-symbolic',
Gtk.IconSize.DND)
image.set_halign(Gtk.Align.CENTER)
- image.get_style_context().add_class('dim-label')
+ image.get_style_context().add_class('workspace-add')
self.add(image)
self.show_all()
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/fb7c6c6fdf01166b643c2d92204a14d37ec7c931
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/fb7c6c6fdf01166b643c2d92204a14d37ec7c931
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