Daniel Brötzmann pushed to branch master at gajim / gajim
Commits: b1212a85 by wurstsalat at 2022-10-13T18:10:17+02:00 fix: WorkspaceSidebar: Don't increase in width while drag and drop
Fixes #11210
- - - - -
4 changed files:
- gajim/data/style/gajim.css - gajim/gtk/app_side_bar.py - gajim/gtk/main.py - gajim/gtk/workspace_side_bar.py
Changes:
===================================== gajim/data/style/gajim.css ===================================== @@ -187,10 +187,14 @@ .chatlist-left-grid { background: @theme_bg_color; }
-.app-sidebar-image { +.app-sidebar-row { + margin: 2px 0 2px 2px; +} +.app-sidebar-row image { background: @unfocused_borders; padding: 4px; } + .app-page-box { margin-top: 3px; } @@ -236,8 +240,8 @@ .workspace-sidebar-item:hover .selection-bar { background-color: @theme_selected_bg_color; } .workspace-sidebar-item image { - border-radius: 9px; - margin: 6px; + border-radius: 9px; + margin: 4px 0 4px 4px; } .workspace-add:hover, .workspace-add:focus { @@ -248,6 +252,9 @@ .workspace-add:focus { .workspace-add button { margin: 6px 8px 6px 14px; } +.workspace-avatar { + border: 2px solid transparent; +}
/* Account sidebar */ .account-sidebar { @@ -824,12 +831,22 @@ .dnd-target { animation-duration: 2.0s; animation-timing-function: ease-in-out; animation-iteration-count: infinite; +} +.dnd-target .workspace-avatar { + border: 2px dashed @theme_selected_bg_color; +} + +.dnd-target-chatlist { + animation-name: pulse-opacity; + animation-duration: 2.0s; + animation-timing-function: ease-in-out; + animation-iteration-count: infinite; border: 2px dashed @theme_selected_bg_color; }
@keyframes pulse-opacity { 0% { opacity: 1.0; } - 20% { opacity: 0.5; } + 20% { opacity: 0.7; } 45% { opacity: 1.0; } } .pulse-opacity {
===================================== gajim/gtk/app_side_bar.py ===================================== @@ -54,6 +54,7 @@ class AppRow(Gtk.ListBoxRow): def __init__(self) -> None: Gtk.ListBoxRow.__init__(self) self.get_style_context().add_class('workspace-sidebar-item') + self.get_style_context().add_class('app-sidebar-row')
self._unread_label = Gtk.Label() self._unread_label.get_style_context().add_class( @@ -64,7 +65,6 @@ def __init__(self) -> None:
surface = load_icon_surface('org.gajim.Gajim', 32) image = Gtk.Image.new_from_surface(surface) - image.get_style_context().add_class('app-sidebar-image')
selection_bar = Gtk.Box() selection_bar.set_size_request(6, -1)
===================================== gajim/gtk/main.py ===================================== @@ -568,8 +568,6 @@ def is_chat_active(self, account: str, jid: JID) -> bool: return self._chat_page.is_chat_selected(account, jid)
def highlight_dnd_targets(self, drag_row: Any, highlight: bool) -> None: - css_class = 'dnd-target' - if isinstance(drag_row, ChatListRow): chat_list_stack = self._chat_page.get_chat_list_stack() workspace = self.get_active_workspace() @@ -583,15 +581,18 @@ def highlight_dnd_targets(self, drag_row: Any, highlight: bool) -> None: continue
if highlight: - row.get_style_context().add_class(css_class) + row.get_style_context().add_class( + 'dnd-target-chatlist') else: - row.get_style_context().remove_class(css_class) + row.get_style_context().remove_class( + 'dnd-target-chatlist')
if highlight: - self._workspace_side_bar.get_style_context().add_class(css_class) + self._workspace_side_bar.get_style_context().add_class( + 'dnd-target') else: self._workspace_side_bar.get_style_context().remove_class( - css_class) + 'dnd-target')
def _add_workspace(self, _action: Gio.SimpleAction,
===================================== gajim/gtk/workspace_side_bar.py ===================================== @@ -404,6 +404,7 @@ class WorkspaceAvatar(Gtk.Image): def __init__(self, workspace_id: str) -> None: Gtk.Image.__init__(self) self._workspace_id = workspace_id + self.get_style_context().add_class('workspace-avatar') self.update()
def update(self) -> None:
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/b1212a85dfc3c8897b93015705d76583a...