make cursor shape pointing hand on button hover

This commit is contained in:
end-4
2025-04-17 16:39:23 +02:00
parent 873cb24642
commit f798b912a6
9 changed files with 24 additions and 5 deletions
@@ -0,0 +1,49 @@
import "root:/modules/common"
import "root:/modules/common/widgets"
import QtQuick
import QtQuick.Controls
import Quickshell.Io
Button {
id: button
property bool toggled
property string buttonIcon
implicitWidth: 40
implicitHeight: 40
PointingHandInteraction {}
background: Rectangle {
anchors.fill: parent
radius: Appearance.rounding.full
color: toggled ?
(button.down ? Appearance.colors.colPrimaryActive : button.hovered ? Appearance.colors.colPrimaryHover : Appearance.m3colors.m3primary) :
(button.down ? Appearance.colors.colLayer1Active : button.hovered ? Appearance.colors.colLayer1Hover : Appearance.transparentize(Appearance.colors.colLayer1Hover, 1))
Behavior on color {
ColorAnimation {
duration: Appearance.animation.elementDecel.duration
easing.type: Appearance.animation.elementDecel.type
}
}
MaterialSymbol {
anchors.centerIn: parent
font.pixelSize: Appearance.font.pixelSize.larger
text: buttonIcon
color: toggled ? Appearance.m3colors.m3onPrimary : Appearance.colors.colOnLayer1
Behavior on color {
ColorAnimation {
duration: Appearance.animation.elementDecel.duration
easing.type: Appearance.animation.elementDecel.type
}
}
}
}
}