From 36b33ba4f1cd76205f8ce4f36b6873ca8bda938f Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sun, 12 Oct 2025 16:30:41 +0200 Subject: [PATCH] make some buttons trigger on mouse down to feel faster --- .config/quickshell/ii/ReloadPopup.qml | 2 +- .config/quickshell/ii/modules/bar/SysTray.qml | 2 +- .config/quickshell/ii/modules/bar/SysTrayMenu.qml | 4 ++-- .config/quickshell/ii/modules/bar/weather/WeatherBar.qml | 2 +- .../quickshell/ii/modules/common/widgets/AddressBar.qml | 4 ++-- .../modules/common/widgets/NavigationRailExpandButton.qml | 2 +- .../ii/modules/common/widgets/PrimaryTabButton.qml | 4 ++-- .../ii/modules/common/widgets/SecondaryTabButton.qml | 4 ++-- .../quickshell/ii/modules/mediaControls/PlayerControl.qml | 6 +++--- .../ii/modules/onScreenKeyboard/OnScreenKeyboard.qml | 4 ++-- .config/quickshell/ii/modules/overview/OverviewWidget.qml | 2 +- .config/quickshell/ii/modules/sidebarLeft/AiChat.qml | 4 ++-- .config/quickshell/ii/modules/sidebarLeft/Anime.qml | 7 ++++--- .../quickshell/ii/modules/sidebarLeft/ApiCommandButton.qml | 2 +- .../ii/modules/sidebarRight/BottomWidgetGroup.qml | 6 +++--- .../ii/modules/sidebarRight/calendar/CalendarWidget.qml | 6 +++--- .../ii/modules/sidebarRight/volumeMixer/VolumeMixer.qml | 4 ++-- .config/quickshell/ii/settings.qml | 4 ++-- 18 files changed, 35 insertions(+), 34 deletions(-) diff --git a/.config/quickshell/ii/ReloadPopup.qml b/.config/quickshell/ii/ReloadPopup.qml index 4b0ecd884..4d858ee3e 100644 --- a/.config/quickshell/ii/ReloadPopup.qml +++ b/.config/quickshell/ii/ReloadPopup.qml @@ -58,7 +58,7 @@ Scope { MouseArea { id: mouseArea anchors.fill: parent - onClicked: { + onPressed: { popupLoader.active = false } diff --git a/.config/quickshell/ii/modules/bar/SysTray.qml b/.config/quickshell/ii/modules/bar/SysTray.qml index 2a6259a97..c23bb6c79 100644 --- a/.config/quickshell/ii/modules/bar/SysTray.qml +++ b/.config/quickshell/ii/modules/bar/SysTray.qml @@ -75,7 +75,7 @@ Item { toggled: root.trayOverflowOpen property bool containsMouse: hovered - onClicked: root.trayOverflowOpen = !root.trayOverflowOpen + downAction: () => root.trayOverflowOpen = !root.trayOverflowOpen Layout.fillHeight: !root.vertical Layout.fillWidth: root.vertical diff --git a/.config/quickshell/ii/modules/bar/SysTrayMenu.qml b/.config/quickshell/ii/modules/bar/SysTrayMenu.qml index 6caffb41c..d9569e608 100644 --- a/.config/quickshell/ii/modules/bar/SysTrayMenu.qml +++ b/.config/quickshell/ii/modules/bar/SysTrayMenu.qml @@ -48,7 +48,7 @@ PopupWindow { MouseArea { anchors.fill: parent acceptedButtons: Qt.BackButton | Qt.RightButton - onClicked: event => { + onPressed: event => { if ((event.button === Qt.BackButton || event.button === Qt.RightButton) && stackView.depth > 1) stackView.pop(); } @@ -152,7 +152,7 @@ PopupWindow { implicitWidth: contentItem.implicitWidth + horizontalPadding * 2 implicitHeight: 36 - onClicked: stackView.pop() + downAction: () => stackView.pop() contentItem: RowLayout { anchors { diff --git a/.config/quickshell/ii/modules/bar/weather/WeatherBar.qml b/.config/quickshell/ii/modules/bar/weather/WeatherBar.qml index b39228ab6..aed2a7ff8 100644 --- a/.config/quickshell/ii/modules/bar/weather/WeatherBar.qml +++ b/.config/quickshell/ii/modules/bar/weather/WeatherBar.qml @@ -15,7 +15,7 @@ MouseArea { hoverEnabled: true - onClicked: { + onPressed: { Weather.getData(); Quickshell.execDetached(["notify-send", Translation.tr("Weather"), diff --git a/.config/quickshell/ii/modules/common/widgets/AddressBar.qml b/.config/quickshell/ii/modules/common/widgets/AddressBar.qml index bf1cf2305..5648beb7a 100644 --- a/.config/quickshell/ii/modules/common/widgets/AddressBar.qml +++ b/.config/quickshell/ii/modules/common/widgets/AddressBar.qml @@ -35,7 +35,7 @@ Rectangle { RippleButton { id: parentDirButton - onClicked: root.navigateToDirectory(FileUtils.parentDirectory(root.directory)) + downAction: () => root.navigateToDirectory(FileUtils.parentDirectory(root.directory)) contentItem: MaterialSymbol { text: "drive_folder_upload" iconSize: Appearance.font.pixelSize.larger @@ -105,7 +105,7 @@ Rectangle { RippleButton { id: dirEditButton toggled: !root.showBreadcrumb - onClicked: root.showBreadcrumb = !root.showBreadcrumb + downAction: () => root.showBreadcrumb = !root.showBreadcrumb contentItem: MaterialSymbol { text: "edit" iconSize: Appearance.font.pixelSize.larger diff --git a/.config/quickshell/ii/modules/common/widgets/NavigationRailExpandButton.qml b/.config/quickshell/ii/modules/common/widgets/NavigationRailExpandButton.qml index 57e15f044..1e562f6ff 100644 --- a/.config/quickshell/ii/modules/common/widgets/NavigationRailExpandButton.qml +++ b/.config/quickshell/ii/modules/common/widgets/NavigationRailExpandButton.qml @@ -9,7 +9,7 @@ RippleButton { implicitWidth: 40 implicitHeight: 40 Layout.leftMargin: 8 - onClicked: { + downAction: () => { parent.expanded = !parent.expanded; } buttonRadius: Appearance.rounding.full diff --git a/.config/quickshell/ii/modules/common/widgets/PrimaryTabButton.qml b/.config/quickshell/ii/modules/common/widgets/PrimaryTabButton.qml index 6c687321c..bedcc2d92 100644 --- a/.config/quickshell/ii/modules/common/widgets/PrimaryTabButton.qml +++ b/.config/quickshell/ii/modules/common/widgets/PrimaryTabButton.qml @@ -32,7 +32,8 @@ TabButton { MouseArea { anchors.fill: parent cursorShape: Qt.PointingHandCursor - onPressed: (event) => { + onPressed: (event) => { + button.click() // Because the MouseArea already consumed the event const {x,y} = event const stateY = buttonBackground.y; rippleAnim.x = x; @@ -46,7 +47,6 @@ TabButton { rippleAnim.restart(); } onReleased: (event) => { - button.click() // Because the MouseArea already consumed the event rippleFadeAnim.restart(); } } diff --git a/.config/quickshell/ii/modules/common/widgets/SecondaryTabButton.qml b/.config/quickshell/ii/modules/common/widgets/SecondaryTabButton.qml index 774da7d51..347774cff 100644 --- a/.config/quickshell/ii/modules/common/widgets/SecondaryTabButton.qml +++ b/.config/quickshell/ii/modules/common/widgets/SecondaryTabButton.qml @@ -30,7 +30,8 @@ TabButton { MouseArea { anchors.fill: parent cursorShape: Qt.PointingHandCursor - onPressed: (event) => { + onPressed: (event) => { + root.click() // Because the MouseArea already consumed the event const {x,y} = event const stateY = buttonBackground.y; rippleAnim.x = x; @@ -44,7 +45,6 @@ TabButton { rippleAnim.restart(); } onReleased: (event) => { - root.click() // Because the MouseArea already consumed the event rippleFadeAnim.restart(); } } diff --git a/.config/quickshell/ii/modules/mediaControls/PlayerControl.qml b/.config/quickshell/ii/modules/mediaControls/PlayerControl.qml index cc248151f..83bc10a22 100644 --- a/.config/quickshell/ii/modules/mediaControls/PlayerControl.qml +++ b/.config/quickshell/ii/modules/mediaControls/PlayerControl.qml @@ -234,7 +234,7 @@ Item { // Player instance } TrackChangeButton { iconName: "skip_previous" - onClicked: root.player?.previous() + downAction: () => root.player?.previous() } Item { id: progressBarContainer @@ -277,7 +277,7 @@ Item { // Player instance } TrackChangeButton { iconName: "skip_next" - onClicked: root.player?.next() + downAction: () => root.player?.next() } } @@ -289,7 +289,7 @@ Item { // Player instance property real size: 44 implicitWidth: size implicitHeight: size - onClicked: root.player.togglePlaying(); + downAction: () => root.player.togglePlaying(); buttonRadius: root.player?.isPlaying ? Appearance?.rounding.normal : size / 2 colBackground: root.player?.isPlaying ? blendedColors.colPrimary : blendedColors.colSecondaryContainer diff --git a/.config/quickshell/ii/modules/onScreenKeyboard/OnScreenKeyboard.qml b/.config/quickshell/ii/modules/onScreenKeyboard/OnScreenKeyboard.qml index d8290abb7..3407c217f 100644 --- a/.config/quickshell/ii/modules/onScreenKeyboard/OnScreenKeyboard.qml +++ b/.config/quickshell/ii/modules/onScreenKeyboard/OnScreenKeyboard.qml @@ -18,7 +18,7 @@ Scope { // Scope baseWidth: 40 baseHeight: 40 clickedWidth: baseWidth - clickedHeight: baseHeight + 20 + clickedHeight: baseHeight + 10 buttonRadius: Appearance.rounding.normal } @@ -84,7 +84,7 @@ Scope { // Scope VerticalButtonGroup { OskControlButton { // Pin button toggled: root.pinned - onClicked: root.pinned = !root.pinned + downAction: () => root.pinned = !root.pinned contentItem: MaterialSymbol { text: "keep" horizontalAlignment: Text.AlignHCenter diff --git a/.config/quickshell/ii/modules/overview/OverviewWidget.qml b/.config/quickshell/ii/modules/overview/OverviewWidget.qml index 0e850493a..b7e8f61d6 100644 --- a/.config/quickshell/ii/modules/overview/OverviewWidget.qml +++ b/.config/quickshell/ii/modules/overview/OverviewWidget.qml @@ -111,7 +111,7 @@ Item { id: workspaceArea anchors.fill: parent acceptedButtons: Qt.LeftButton - onClicked: { + onPressed: { if (root.draggingTargetWorkspace === -1) { GlobalStates.overviewOpen = false Hyprland.dispatch(`workspace ${workspaceValue}`) diff --git a/.config/quickshell/ii/modules/sidebarLeft/AiChat.qml b/.config/quickshell/ii/modules/sidebarLeft/AiChat.qml index 4e195575b..90ad9a451 100644 --- a/.config/quickshell/ii/modules/sidebarLeft/AiChat.qml +++ b/.config/quickshell/ii/modules/sidebarLeft/AiChat.qml @@ -757,8 +757,8 @@ Inline w/ backslash and round brackets \\(e^{i\\pi} + 1 = 0\\) delegate: ApiCommandButton { property string commandRepresentation: `${root.commandPrefix}${modelData.name}` buttonText: commandRepresentation - onClicked: { - if(modelData.sendDirectly) { + downAction: () => { + if (modelData.sendDirectly) { root.handleInput(commandRepresentation) } else { messageInputField.text = commandRepresentation + (modelData.dontAddSpace ? "" : " ") diff --git a/.config/quickshell/ii/modules/sidebarLeft/Anime.qml b/.config/quickshell/ii/modules/sidebarLeft/Anime.qml index 19b930958..13c584feb 100644 --- a/.config/quickshell/ii/modules/sidebarLeft/Anime.qml +++ b/.config/quickshell/ii/modules/sidebarLeft/Anime.qml @@ -525,9 +525,10 @@ Item { anchors.centerIn: parent MouseArea { + anchors.fill: parent hoverEnabled: true PointingHandInteraction {} - onClicked: { + onPressed: { nsfwSwitch.checked = !nsfwSwitch.checked } } @@ -566,8 +567,8 @@ Item { buttonText: commandRepresentation colBackground: Appearance.colors.colLayer2 - onClicked: { - if(modelData.sendDirectly) { + downAction: () => { + if (modelData.sendDirectly) { root.handleInput(commandRepresentation) } else { tagInputField.text = commandRepresentation + " " diff --git a/.config/quickshell/ii/modules/sidebarLeft/ApiCommandButton.qml b/.config/quickshell/ii/modules/sidebarLeft/ApiCommandButton.qml index efbde1506..34567ee0d 100644 --- a/.config/quickshell/ii/modules/sidebarLeft/ApiCommandButton.qml +++ b/.config/quickshell/ii/modules/sidebarLeft/ApiCommandButton.qml @@ -10,7 +10,7 @@ GroupButton { verticalPadding: 6 baseWidth: contentItem.implicitWidth + horizontalPadding * 2 - clickedWidth: baseWidth + 20 + clickedWidth: baseWidth + 14 baseHeight: contentItem.implicitHeight + verticalPadding * 2 buttonRadius: down ? Appearance.rounding.verysmall : Appearance.rounding.small diff --git a/.config/quickshell/ii/modules/sidebarRight/BottomWidgetGroup.qml b/.config/quickshell/ii/modules/sidebarRight/BottomWidgetGroup.qml index cd5385c75..a620c0cbb 100644 --- a/.config/quickshell/ii/modules/sidebarRight/BottomWidgetGroup.qml +++ b/.config/quickshell/ii/modules/sidebarRight/BottomWidgetGroup.qml @@ -83,7 +83,7 @@ Rectangle { Layout.margins: 10 Layout.rightMargin: 0 forceCircle: true - onClicked: { + downAction: () => { root.setCollapsed(false) } contentItem: MaterialSymbol { @@ -146,7 +146,7 @@ Rectangle { toggled: root.selectedTab == index buttonText: modelData.name buttonIcon: modelData.icon - onClicked: { + onPressed: { root.selectedTab = index Persistent.states.sidebar.bottomGroup.tab = index } @@ -158,7 +158,7 @@ Rectangle { anchors.left: parent.left anchors.top: parent.top forceCircle: true - onClicked: { + downAction: () => { root.setCollapsed(true) } contentItem: MaterialSymbol { diff --git a/.config/quickshell/ii/modules/sidebarRight/calendar/CalendarWidget.qml b/.config/quickshell/ii/modules/sidebarRight/calendar/CalendarWidget.qml index 3af804e3e..393407a92 100644 --- a/.config/quickshell/ii/modules/sidebarRight/calendar/CalendarWidget.qml +++ b/.config/quickshell/ii/modules/sidebarRight/calendar/CalendarWidget.qml @@ -50,7 +50,7 @@ Item { clip: true buttonText: `${monthShift != 0 ? "• " : ""}${viewingDate.toLocaleDateString(Qt.locale(), "MMMM yyyy")}` tooltipText: (monthShift === 0) ? "" : Translation.tr("Jump to current month") - onClicked: { + downAction: () => { monthShift = 0; } } @@ -60,7 +60,7 @@ Item { } CalendarHeaderButton { forceCircle: true - onClicked: { + downAction: () => { monthShift--; } contentItem: MaterialSymbol { @@ -72,7 +72,7 @@ Item { } CalendarHeaderButton { forceCircle: true - onClicked: { + downAction: () => { monthShift++; } contentItem: MaterialSymbol { diff --git a/.config/quickshell/ii/modules/sidebarRight/volumeMixer/VolumeMixer.qml b/.config/quickshell/ii/modules/sidebarRight/volumeMixer/VolumeMixer.qml index 13bebf94b..1544bee39 100644 --- a/.config/quickshell/ii/modules/sidebarRight/volumeMixer/VolumeMixer.qml +++ b/.config/quickshell/ii/modules/sidebarRight/volumeMixer/VolumeMixer.qml @@ -109,12 +109,12 @@ Item { AudioDeviceSelectorButton { Layout.fillWidth: true input: false - onClicked: root.showDeviceSelectorDialog(input) + downAction: () => root.showDeviceSelectorDialog(input) } AudioDeviceSelectorButton { Layout.fillWidth: true input: true - onClicked: root.showDeviceSelectorDialog(input) + downAction: () => root.showDeviceSelectorDialog(input) } } } diff --git a/.config/quickshell/ii/settings.qml b/.config/quickshell/ii/settings.qml index 64728412c..2b5978ec9 100644 --- a/.config/quickshell/ii/settings.qml +++ b/.config/quickshell/ii/settings.qml @@ -172,7 +172,7 @@ ApplicationWindow { iconText: "edit" buttonText: Translation.tr("Config file") expanded: navRail.expanded - onClicked: { + downAction: () => { Qt.openUrlExternally(`${Directories.config}/illogical-impulse/config.json`); } @@ -190,7 +190,7 @@ ApplicationWindow { required property var index required property var modelData toggled: root.currentPage === index - onClicked: root.currentPage = index; + onPressed: root.currentPage = index; expanded: navRail.expanded buttonIcon: modelData.icon buttonIconRotation: modelData.iconRotation || 0