From 31bb92c39836baeedf5bb32ed76700d265507eaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristijan=20Ribari=C4=87?= Date: Thu, 24 Oct 2024 20:27:46 +0200 Subject: [PATCH] feat: Handle workspace panel hiding event This commit adds a new `onpopuphidden` attribute to the `` element that defines the workspace panel. This attribute triggers the `ZenWorkspaces.handlePanelHidden()` function when the panel is hidden. This change is necessary to allow the application to properly handle the case when the workspace panel is hidden so that the reorder mode can be disabled. The following changes were made: - Added the `onpopuphidden` attribute to the `` element in `zen-popupset.inc.xhtml`. - Added a new CSS class `.zen-workspace-last-place-drop-target` to `zen-workspaces.css`. - Modified the `zen-workspaces.css` file to display the `.zen-workspace-last-place-drop-target` class only in reorder mode. --- src/browser/base/content/zen-popupset.inc.xhtml | 2 +- .../base/content/zen-styles/zen-workspaces.css | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/browser/base/content/zen-popupset.inc.xhtml b/src/browser/base/content/zen-popupset.inc.xhtml index 059c7137d..0ecc0c96d 100644 --- a/src/browser/base/content/zen-popupset.inc.xhtml +++ b/src/browser/base/content/zen-popupset.inc.xhtml @@ -101,7 +101,7 @@ - + diff --git a/src/browser/base/content/zen-styles/zen-workspaces.css b/src/browser/base/content/zen-styles/zen-workspaces.css index 94f94a155..a6c7892da 100644 --- a/src/browser/base/content/zen-styles/zen-workspaces.css +++ b/src/browser/base/content/zen-styles/zen-workspaces.css @@ -345,6 +345,11 @@ border-radius: 5px; } +.zen-workspace-last-place-drop-target.dragover { + background-color: var(--toolbarbutton-icon-fill-attention); +} + + #PanelUI-zen-workspaces-reorder-mode[active='true'] { color: var(--toolbarbutton-icon-fill-attention) !important; } @@ -362,6 +367,17 @@ } } +#PanelUI-zen-workspaces-list[reorder-mode='true'] .zen-workspace-last-place-drop-target { + display: block; +} + +.zen-workspace-last-place-drop-target { + display: none; + height: 4px; + width: 100%; + border-radius: 5px; +} + #PanelUI-zen-workspaces-view > vbox:nth-child(2) { margin-top: 10px; }