diff --git a/components/StyledDrawer.qml b/components/StyledDrawer.qml index f0816fd..a87f8fd 100644 --- a/components/StyledDrawer.qml +++ b/components/StyledDrawer.qml @@ -1,11 +1,29 @@ import qs.config import QtQuick import QtQuick.Controls +import Quickshell +import Quickshell.Hyprland +import Quickshell.Widgets Drawer { id: control dim: false - background: Rectangle { + property bool focused: false + + onVisibleChanged: { + focused = visible; + } + + HyprlandFocusGrab { + active: control.focused + windows: [QsWindow.window] + onCleared: { + control.focused = false; + } + } + + background: ClippingWrapperRectangle { + margin: 4 Component.onCompleted: { if (control.edge == Qt.TopEdge) { radius = 8; @@ -20,6 +38,24 @@ Drawer { topRightRadius = 8; } } - color: Styling.theme.base100 + color: Styling.theme.base300 + + Rectangle { + Component.onCompleted: { + if (control.edge == Qt.TopEdge) { + radius = 8; + } else if (control.edge == Qt.LeftEdge) { + topRightRadius = 8; + bottomRightRadius = 8; + } else if (control.edge == Qt.RightEdge) { + topLeftRadius = 8; + bottomLeftRadius = 8; + } else if (control.edge == Qt.BottomEdge) { + topLeftRadius = 8; + topRightRadius = 8; + } + } + color: Styling.theme.base100 + } } } diff --git a/modules/drawers/dashboard/Dashboard.qml b/modules/drawers/dashboard/Dashboard.qml index 5dea95e..5af5285 100644 --- a/modules/drawers/dashboard/Dashboard.qml +++ b/modules/drawers/dashboard/Dashboard.qml @@ -12,6 +12,10 @@ StyledDrawer { visible: Visibility.dashboard + onFocusedChanged: { + Visibility.dashboard = focused; + } + WrapperItem { margin: 32 ColumnLayout {