feat: Handle workspace panel hiding event

This commit adds a new `onpopuphidden` attribute to the `<panel>` 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 `<panel>` 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.
This commit is contained in:
Kristijan Ribarić
2024-10-24 20:27:46 +02:00
parent 065e82534e
commit 31bb92c398
2 changed files with 17 additions and 1 deletions

View File

@@ -101,7 +101,7 @@
</vbox>
</panelview>
<panel flip="slide" type="arrow" orient="vertical" id="PanelUI-zen-workspaces" position="bottomright topright" mainview="true" side="left">
<panel flip="slide" type="arrow" orient="vertical" id="PanelUI-zen-workspaces" position="bottomright topright" mainview="true" side="left" onpopuphidden="ZenWorkspaces.handlePanelHidden();">
<panelmultiview id="PanelUI-zen-workspaces-multiview" mainViewId="PanelUI-zen-workspaces-view">
<panelview id="PanelUI-zen-workspaces-view" class="PanelUI-subView" role="document" mainview-with-header="true" has-custom-header="true" closemenu="none">
<vbox>

View File

@@ -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;
}