forked from Shinonome/dots-hyprland
per-monitor handling of sidebar opening
This commit is contained in:
@@ -6,6 +6,8 @@ import QtQuick.Layouts
|
||||
import Quickshell.Io
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import Quickshell.Hyprland
|
||||
import Qt5Compat.GraphicalEffects
|
||||
|
||||
Scope {
|
||||
id: bar
|
||||
@@ -13,6 +15,7 @@ Scope {
|
||||
readonly property int sidebarWidth: Appearance.sizes.sidebarWidth
|
||||
|
||||
Variants {
|
||||
id: sidebarVariants
|
||||
model: Quickshell.screens
|
||||
|
||||
PanelWindow {
|
||||
@@ -45,26 +48,31 @@ Scope {
|
||||
}
|
||||
|
||||
// Shadow
|
||||
// DropShadow {
|
||||
// anchors.fill: sideRightBackground
|
||||
// horizontalOffset: 0
|
||||
// verticalOffset: 2
|
||||
// radius: 3
|
||||
// samples: 17
|
||||
// color: Appearance.m3colors.m3shadow
|
||||
// source: sideRightBackground
|
||||
// }
|
||||
|
||||
IpcHandler {
|
||||
target: "sidebarRight"
|
||||
|
||||
function toggle(): void {
|
||||
sidebarRoot.visible = !sidebarRoot.visible
|
||||
}
|
||||
DropShadow {
|
||||
anchors.fill: sidebarRightBackground
|
||||
horizontalOffset: 0
|
||||
verticalOffset: 2
|
||||
radius: Appearance.sizes.elevationMargin
|
||||
samples: Appearance.sizes.elevationMargin * 2 + 1 // Ideally should be 2 * radius + 1, see qt docs
|
||||
color: Appearance.transparentize(Appearance.m3colors.m3shadow, 0.55)
|
||||
source: sidebarRightBackground
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
IpcHandler {
|
||||
target: "sidebarRight"
|
||||
|
||||
function toggle(): void {
|
||||
for (let i = 0; i < sidebarVariants.instances.length; i++) {
|
||||
let panelWindow = sidebarVariants.instances[i];
|
||||
if (panelWindow.modelData.name == Hyprland.focusedMonitor.name) {
|
||||
panelWindow.visible = !panelWindow.visible;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user