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

@@ -0,0 +1,34 @@
import QtQuick
Rectangle {
id: root
property color idleColor: "transparent"
property color hoverColor: "transparent"
property color pressColor: "transparent"
property color borderIdleColor: "transparent"
property color borderHoverColor: "transparent"
property real pressScale: 0.97
property int animDuration: 150
readonly property bool hovered: _hover.hovered
readonly property bool pressed: _tap.pressed
signal clicked()
color: pressed ? pressColor : (hovered ? hoverColor : idleColor)
border.color: hovered ? borderHoverColor : borderIdleColor
scale: pressed ? pressScale : 1.0
Behavior on color { ColorAnimation { duration: root.animDuration } }
Behavior on border.color { ColorAnimation { duration: root.animDuration } }
Behavior on scale { NumberAnimation { duration: 100; easing.type: Easing.OutQuad } }
HoverHandler { id: _hover }
TapHandler {
id: _tap
cursorShape: Qt.PointingHandCursor
onTapped: root.clicked()
}
}