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
@@ -12,6 +12,8 @@ Button {
implicitHeight: 30 implicitHeight: 30
implicitWidth: buttonTextWidget.implicitWidth + 15 * 2 implicitWidth: buttonTextWidget.implicitWidth + 15 * 2
PointingHandInteraction {}
background: Rectangle { background: Rectangle {
anchors.fill: parent anchors.fill: parent
radius: Appearance.rounding.full radius: Appearance.rounding.full
@@ -34,7 +36,7 @@ Button {
anchors.rightMargin: 15 anchors.rightMargin: 15
text: buttonText text: buttonText
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
font.pixelSize: Appearance.font.pixelSize.normal font.pixelSize: Appearance.font.pixelSize.small
color: button.enabled ? Appearance.m3colors.m3primary : Appearance.m3colors.m3outline color: button.enabled ? Appearance.m3colors.m3primary : Appearance.m3colors.m3outline
Behavior on color { Behavior on color {
@@ -16,7 +16,8 @@ Button {
implicitHeight: columnLayout.implicitHeight implicitHeight: columnLayout.implicitHeight
implicitWidth: columnLayout.implicitWidth implicitWidth: columnLayout.implicitWidth
background: Item{} // No ugly bg background: Item {}
PointingHandInteraction {}
// Real stuff // Real stuff
ColumnLayout { ColumnLayout {
@@ -0,0 +1,7 @@
import QtQuick
MouseArea {
anchors.fill: parent
onPressed: mouse.accepted = false
cursorShape: Qt.PointingHandCursor
}
@@ -11,6 +11,8 @@ Button {
required default property Item content required default property Item content
property bool extraActiveCondition: false property bool extraActiveCondition: false
PointingHandInteraction{}
implicitHeight: Math.max(content.implicitHeight, 26, content.implicitHeight) implicitHeight: Math.max(content.implicitHeight, 26, content.implicitHeight)
implicitWidth: Math.max(content.implicitHeight, 26, content.implicitWidth) implicitWidth: Math.max(content.implicitHeight, 26, content.implicitWidth)
contentItem: content contentItem: content
@@ -13,6 +13,8 @@ TabButton {
property bool selected: false property bool selected: false
height: buttonBackground.height height: buttonBackground.height
PointingHandInteraction {}
background: Rectangle { background: Rectangle {
id: buttonBackground id: buttonBackground
radius: Appearance.rounding.small radius: Appearance.rounding.small
@@ -12,13 +12,14 @@ Button {
implicitHeight: 30 implicitHeight: 30
implicitWidth: forceCircle ? implicitHeight : (contentItem.implicitWidth + 10 * 2) implicitWidth: forceCircle ? implicitHeight : (contentItem.implicitWidth + 10 * 2)
Behavior on implicitWidth { Behavior on implicitWidth {
SmoothedAnimation { SmoothedAnimation {
velocity: Appearance.animation.elementDecel.velocity velocity: Appearance.animation.elementDecel.velocity
} }
} }
PointingHandInteraction {}
background: Rectangle { background: Rectangle {
anchors.fill: parent anchors.fill: parent
radius: Appearance.rounding.full radius: Appearance.rounding.full
@@ -13,6 +13,8 @@ Button {
implicitWidth: 40 implicitWidth: 40
implicitHeight: 40 implicitHeight: 40
PointingHandInteraction {}
background: Rectangle { background: Rectangle {
anchors.fill: parent anchors.fill: parent
radius: Appearance.rounding.full radius: Appearance.rounding.full
@@ -12,6 +12,8 @@ Button {
implicitHeight: 30 implicitHeight: 30
implicitWidth: implicitHeight implicitWidth: implicitHeight
PointingHandInteraction {}
Behavior on implicitWidth { Behavior on implicitWidth {
SmoothedAnimation { SmoothedAnimation {
velocity: Appearance.animation.elementDecel.velocity velocity: Appearance.animation.elementDecel.velocity
@@ -11,7 +11,7 @@ Item {
property int currentTab: 0 property int currentTab: 0
property var tabButtonList: [{"icon": "checklist", "name": "Unfinished"}, {"name": "Done", "icon": "check_circle"}] property var tabButtonList: [{"icon": "checklist", "name": "Unfinished"}, {"name": "Done", "icon": "check_circle"}]
property bool showAddDialog: false property bool showAddDialog: false
property int dialogMargins: 25 property int dialogMargins: 20
property int fabSize: 48 property int fabSize: 48
property int fabMargins: 14 property int fabMargins: 14
@@ -124,9 +124,9 @@ Item {
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.rightMargin: root.fabMargins anchors.rightMargin: root.fabMargins
anchors.bottomMargin: root.fabMargins anchors.bottomMargin: root.fabMargins
width: root.fabSize width: root.fabSize
height: root.fabSize height: root.fabSize
PointingHandInteraction {}
onClicked: root.showAddDialog = true onClicked: root.showAddDialog = true