simplify StyledPopupWindow

This commit is contained in:
Benjamin Palko 2025-09-07 09:31:19 -04:00
parent fdcaa77581
commit 1e6535e6b2
4 changed files with 4 additions and 23 deletions

View file

@ -1,22 +1,15 @@
import QtQuick
import Quickshell
import Quickshell.Hyprland
import Quickshell.Widgets
PopupWindow {
id: root
property bool opened: false
property int animationDuration: 200
property alias margins: background.margin
property alias backgroundColor: background.color
property alias radius: background.radius
property alias state: background.state
required property Component content
color: "transparent"
function toggle() {
root.state = root.state == "opened" ? "closed" : "opened";
background.state = background.state == "opened" ? "closed" : "opened";
}
HyprlandFocusGrab {
@ -24,16 +17,17 @@ PopupWindow {
active: root.visible
windows: [root]
onCleared: {
root.state = "closed";
background.state = "closed";
}
}
implicitWidth: background.width
implicitHeight: background.height
WrapperRectangle {
StyledWrapperRectangle {
id: background
margin: 16
focus: true
onFocusChanged: {
if (!focus) {