small component patches + code cleanup

This commit is contained in:
SomeElse
2026-05-17 22:30:27 +00:00
parent 262fd8afa0
commit 6db876fc8a
21 changed files with 469 additions and 465 deletions

View File

@@ -4,6 +4,7 @@ import Quickshell.Wayland
import Quickshell.Services.Polkit
import "../config" as Cfg
import "../components"
Item {
@@ -115,37 +116,18 @@ Item {
color: t.polkitOverlayBg
}
component DialogButton: Rectangle {
component DialogButton: HoverButton {
property string label
property int labelWeight: Font.Normal
property color bgColor
property color bgHoverColor
property color borderColor
property color borderHoverColor
property color labelColor
signal tapped()
width: (parent.width - 12) / 2
height: 44
radius: 10
HoverHandler { id: hover }
color: hover.hovered ? bgHoverColor : bgColor
border.color: hover.hovered ? borderHoverColor : borderColor
border.width: 1
Behavior on color { ColorAnimation { duration: 200 } }
Behavior on border.color { ColorAnimation { duration: 200 } }
scale: pressHandler.pressed ? 0.97 : 1.0
Behavior on scale { NumberAnimation { duration: 100; easing.type: Easing.OutQuad } }
TapHandler {
id: pressHandler
cursorShape: Qt.PointingHandCursor
onTapped: parent.tapped()
}
onClicked: tapped()
Text {
anchors.centerIn: parent
@@ -464,20 +446,22 @@ Item {
label: "Authenticate"
labelWeight: Font.Medium
labelColor: t.polkitAuthText
bgColor: t.polkitAuthBg
bgHoverColor: t.polkitAuthBgHover
borderColor: t.polkitAuthBg
idleColor: t.polkitAuthBg
hoverColor: t.polkitAuthBgHover
borderIdleColor: t.polkitAuthBg
borderHoverColor: t.polkitAuthBgHover
animDuration: 200
onTapped: root.submitAuth()
}
DialogButton {
label: "Cancel"
labelColor: t.polkitCancelText
bgColor: t.polkitCancelBg
bgHoverColor: t.polkitCancelBgHover
borderColor: t.polkitCancelBorder
idleColor: t.polkitCancelBg
hoverColor: t.polkitCancelBgHover
borderIdleColor: t.polkitCancelBorder
borderHoverColor: t.polkitCancelBgHover
animDuration: 200
onTapped: overlay.cancelAndClose()
}
}