From f798b912a6eac2133fd1555ba2a1eb09d67e7536 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Thu, 17 Apr 2025 16:39:23 +0200 Subject: [PATCH] make cursor shape pointing hand on button hover --- .config/quickshell/modules/common/widgets/DialogButton.qml | 4 +++- .../quickshell/modules/common/widgets/NavRailButton.qml | 3 ++- .../modules/common/widgets/PointingHandInteraction.qml | 7 +++++++ .../modules/common/widgets/SmallCircleButton.qml | 2 ++ .../quickshell/modules/common/widgets/StyledTabButton.qml | 2 ++ .../modules/sidebarRight/calendar/CalendarHeaderButton.qml | 3 ++- .../sidebarRight/{ => quickToggles}/QuickToggleButton.qml | 2 ++ .../modules/sidebarRight/todo/TodoItemActionButton.qml | 2 ++ .../quickshell/modules/sidebarRight/todo/TodoWidget.qml | 4 ++-- 9 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 .config/quickshell/modules/common/widgets/PointingHandInteraction.qml rename .config/quickshell/modules/sidebarRight/{ => quickToggles}/QuickToggleButton.qml (97%) diff --git a/.config/quickshell/modules/common/widgets/DialogButton.qml b/.config/quickshell/modules/common/widgets/DialogButton.qml index 46dfa16d8..cc8ea6174 100644 --- a/.config/quickshell/modules/common/widgets/DialogButton.qml +++ b/.config/quickshell/modules/common/widgets/DialogButton.qml @@ -12,6 +12,8 @@ Button { implicitHeight: 30 implicitWidth: buttonTextWidget.implicitWidth + 15 * 2 + PointingHandInteraction {} + background: Rectangle { anchors.fill: parent radius: Appearance.rounding.full @@ -34,7 +36,7 @@ Button { anchors.rightMargin: 15 text: buttonText horizontalAlignment: Text.AlignHCenter - font.pixelSize: Appearance.font.pixelSize.normal + font.pixelSize: Appearance.font.pixelSize.small color: button.enabled ? Appearance.m3colors.m3primary : Appearance.m3colors.m3outline Behavior on color { diff --git a/.config/quickshell/modules/common/widgets/NavRailButton.qml b/.config/quickshell/modules/common/widgets/NavRailButton.qml index 935d98063..2ccbe5529 100644 --- a/.config/quickshell/modules/common/widgets/NavRailButton.qml +++ b/.config/quickshell/modules/common/widgets/NavRailButton.qml @@ -16,7 +16,8 @@ Button { implicitHeight: columnLayout.implicitHeight implicitWidth: columnLayout.implicitWidth - background: Item{} // No ugly bg + background: Item {} + PointingHandInteraction {} // Real stuff ColumnLayout { diff --git a/.config/quickshell/modules/common/widgets/PointingHandInteraction.qml b/.config/quickshell/modules/common/widgets/PointingHandInteraction.qml new file mode 100644 index 000000000..202cd6f3c --- /dev/null +++ b/.config/quickshell/modules/common/widgets/PointingHandInteraction.qml @@ -0,0 +1,7 @@ +import QtQuick + +MouseArea { + anchors.fill: parent + onPressed: mouse.accepted = false + cursorShape: Qt.PointingHandCursor +} \ No newline at end of file diff --git a/.config/quickshell/modules/common/widgets/SmallCircleButton.qml b/.config/quickshell/modules/common/widgets/SmallCircleButton.qml index 14d7c19e3..091e37200 100644 --- a/.config/quickshell/modules/common/widgets/SmallCircleButton.qml +++ b/.config/quickshell/modules/common/widgets/SmallCircleButton.qml @@ -11,6 +11,8 @@ Button { required default property Item content property bool extraActiveCondition: false + PointingHandInteraction{} + implicitHeight: Math.max(content.implicitHeight, 26, content.implicitHeight) implicitWidth: Math.max(content.implicitHeight, 26, content.implicitWidth) contentItem: content diff --git a/.config/quickshell/modules/common/widgets/StyledTabButton.qml b/.config/quickshell/modules/common/widgets/StyledTabButton.qml index 47d447b78..3e83712e6 100644 --- a/.config/quickshell/modules/common/widgets/StyledTabButton.qml +++ b/.config/quickshell/modules/common/widgets/StyledTabButton.qml @@ -13,6 +13,8 @@ TabButton { property bool selected: false height: buttonBackground.height + PointingHandInteraction {} + background: Rectangle { id: buttonBackground radius: Appearance.rounding.small diff --git a/.config/quickshell/modules/sidebarRight/calendar/CalendarHeaderButton.qml b/.config/quickshell/modules/sidebarRight/calendar/CalendarHeaderButton.qml index babe3a26f..342652837 100644 --- a/.config/quickshell/modules/sidebarRight/calendar/CalendarHeaderButton.qml +++ b/.config/quickshell/modules/sidebarRight/calendar/CalendarHeaderButton.qml @@ -12,13 +12,14 @@ Button { implicitHeight: 30 implicitWidth: forceCircle ? implicitHeight : (contentItem.implicitWidth + 10 * 2) - Behavior on implicitWidth { SmoothedAnimation { velocity: Appearance.animation.elementDecel.velocity } } + PointingHandInteraction {} + background: Rectangle { anchors.fill: parent radius: Appearance.rounding.full diff --git a/.config/quickshell/modules/sidebarRight/QuickToggleButton.qml b/.config/quickshell/modules/sidebarRight/quickToggles/QuickToggleButton.qml similarity index 97% rename from .config/quickshell/modules/sidebarRight/QuickToggleButton.qml rename to .config/quickshell/modules/sidebarRight/quickToggles/QuickToggleButton.qml index 012784201..07c02f46d 100644 --- a/.config/quickshell/modules/sidebarRight/QuickToggleButton.qml +++ b/.config/quickshell/modules/sidebarRight/quickToggles/QuickToggleButton.qml @@ -13,6 +13,8 @@ Button { implicitWidth: 40 implicitHeight: 40 + PointingHandInteraction {} + background: Rectangle { anchors.fill: parent radius: Appearance.rounding.full diff --git a/.config/quickshell/modules/sidebarRight/todo/TodoItemActionButton.qml b/.config/quickshell/modules/sidebarRight/todo/TodoItemActionButton.qml index 4bfdf61fe..43c8626a0 100644 --- a/.config/quickshell/modules/sidebarRight/todo/TodoItemActionButton.qml +++ b/.config/quickshell/modules/sidebarRight/todo/TodoItemActionButton.qml @@ -12,6 +12,8 @@ Button { implicitHeight: 30 implicitWidth: implicitHeight + PointingHandInteraction {} + Behavior on implicitWidth { SmoothedAnimation { velocity: Appearance.animation.elementDecel.velocity diff --git a/.config/quickshell/modules/sidebarRight/todo/TodoWidget.qml b/.config/quickshell/modules/sidebarRight/todo/TodoWidget.qml index 539db74eb..b84368634 100644 --- a/.config/quickshell/modules/sidebarRight/todo/TodoWidget.qml +++ b/.config/quickshell/modules/sidebarRight/todo/TodoWidget.qml @@ -11,7 +11,7 @@ Item { property int currentTab: 0 property var tabButtonList: [{"icon": "checklist", "name": "Unfinished"}, {"name": "Done", "icon": "check_circle"}] property bool showAddDialog: false - property int dialogMargins: 25 + property int dialogMargins: 20 property int fabSize: 48 property int fabMargins: 14 @@ -124,9 +124,9 @@ Item { anchors.bottom: parent.bottom anchors.rightMargin: root.fabMargins anchors.bottomMargin: root.fabMargins - width: root.fabSize height: root.fabSize + PointingHandInteraction {} onClicked: root.showAddDialog = true