forked from Shinonome/dots-hyprland
toggleable sidebar
This commit is contained in:
@@ -3,7 +3,9 @@ import "../common/widgets"
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell.Io
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
|
||||
Scope {
|
||||
id: bar
|
||||
@@ -14,13 +16,15 @@ Scope {
|
||||
model: Quickshell.screens
|
||||
|
||||
PanelWindow {
|
||||
id: barRoot
|
||||
id: sidebarRoot
|
||||
visible: false
|
||||
|
||||
property var modelData
|
||||
|
||||
screen: modelData
|
||||
exclusiveZone: 0
|
||||
width: sidebarWidth
|
||||
WlrLayershell.namespace: "quickshell:sidebarRight"
|
||||
color: "transparent"
|
||||
|
||||
anchors {
|
||||
@@ -32,6 +36,7 @@ Scope {
|
||||
// Background
|
||||
Rectangle {
|
||||
id: sidebarRightBackground
|
||||
|
||||
anchors.centerIn: parent
|
||||
width: parent.width - Appearance.sizes.hyprlandGapsOut * 2
|
||||
height: parent.height - Appearance.sizes.hyprlandGapsOut * 2
|
||||
@@ -39,6 +44,25 @@ Scope {
|
||||
radius: Appearance.rounding.screenRounding - Appearance.sizes.elevationMargin + 1
|
||||
}
|
||||
|
||||
// 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
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user