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

@@ -13,4 +13,44 @@ Rectangle {
readonly property var t: Cfg.Config.theme
property bool moduleEnabled: true
property bool hovered: false
property bool popupOpen: false
property color chipColor: "transparent"
property color chipColorHovered: "transparent"
property color chipBorderColor: "transparent"
property color chipBorderColorHovered: "transparent"
property bool chipHoverEnabled: false
property var chipTapAction: null
property int chipAnimDuration: 150
property bool chipAnimWidth: false
property bool chipAnimImplicitWidth: false
radius: panelRadius
color: hovered ? chipColorHovered : chipColor
border.color: (hovered || popupOpen) ? chipBorderColorHovered : chipBorderColor
border.width: borderWidth
Behavior on color { ColorAnimation { duration: chip.chipAnimDuration } }
Behavior on border.color { ColorAnimation { duration: chip.chipAnimDuration } }
Behavior on width {
NumberAnimation { duration: 250; easing.type: Easing.OutCubic }
enabled: chipAnimWidth
}
Behavior on implicitWidth {
NumberAnimation { duration: 250; easing.type: Easing.OutCubic }
enabled: chipAnimImplicitWidth
}
HoverHandler {
id: hoverHandler
cursorShape: chipHoverEnabled ? Qt.PointingHandCursor : Qt.ArrowCursor
onHoveredChanged: chip.hovered = hovered
}
TapHandler {
onTapped: if (chip.chipTapAction) chip.chipTapAction()
}
}