mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-06-05 23:09:26 -05:00
make some buttons trigger on mouse down to feel faster
This commit is contained in:
@@ -58,7 +58,7 @@ Scope {
|
|||||||
MouseArea {
|
MouseArea {
|
||||||
id: mouseArea
|
id: mouseArea
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onClicked: {
|
onPressed: {
|
||||||
popupLoader.active = false
|
popupLoader.active = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ Item {
|
|||||||
toggled: root.trayOverflowOpen
|
toggled: root.trayOverflowOpen
|
||||||
property bool containsMouse: hovered
|
property bool containsMouse: hovered
|
||||||
|
|
||||||
onClicked: root.trayOverflowOpen = !root.trayOverflowOpen
|
downAction: () => root.trayOverflowOpen = !root.trayOverflowOpen
|
||||||
|
|
||||||
Layout.fillHeight: !root.vertical
|
Layout.fillHeight: !root.vertical
|
||||||
Layout.fillWidth: root.vertical
|
Layout.fillWidth: root.vertical
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ PopupWindow {
|
|||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
acceptedButtons: Qt.BackButton | Qt.RightButton
|
acceptedButtons: Qt.BackButton | Qt.RightButton
|
||||||
onClicked: event => {
|
onPressed: event => {
|
||||||
if ((event.button === Qt.BackButton || event.button === Qt.RightButton) && stackView.depth > 1)
|
if ((event.button === Qt.BackButton || event.button === Qt.RightButton) && stackView.depth > 1)
|
||||||
stackView.pop();
|
stackView.pop();
|
||||||
}
|
}
|
||||||
@@ -152,7 +152,7 @@ PopupWindow {
|
|||||||
implicitWidth: contentItem.implicitWidth + horizontalPadding * 2
|
implicitWidth: contentItem.implicitWidth + horizontalPadding * 2
|
||||||
implicitHeight: 36
|
implicitHeight: 36
|
||||||
|
|
||||||
onClicked: stackView.pop()
|
downAction: () => stackView.pop()
|
||||||
|
|
||||||
contentItem: RowLayout {
|
contentItem: RowLayout {
|
||||||
anchors {
|
anchors {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ MouseArea {
|
|||||||
|
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
|
|
||||||
onClicked: {
|
onPressed: {
|
||||||
Weather.getData();
|
Weather.getData();
|
||||||
Quickshell.execDetached(["notify-send",
|
Quickshell.execDetached(["notify-send",
|
||||||
Translation.tr("Weather"),
|
Translation.tr("Weather"),
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ Rectangle {
|
|||||||
|
|
||||||
RippleButton {
|
RippleButton {
|
||||||
id: parentDirButton
|
id: parentDirButton
|
||||||
onClicked: root.navigateToDirectory(FileUtils.parentDirectory(root.directory))
|
downAction: () => root.navigateToDirectory(FileUtils.parentDirectory(root.directory))
|
||||||
contentItem: MaterialSymbol {
|
contentItem: MaterialSymbol {
|
||||||
text: "drive_folder_upload"
|
text: "drive_folder_upload"
|
||||||
iconSize: Appearance.font.pixelSize.larger
|
iconSize: Appearance.font.pixelSize.larger
|
||||||
@@ -105,7 +105,7 @@ Rectangle {
|
|||||||
RippleButton {
|
RippleButton {
|
||||||
id: dirEditButton
|
id: dirEditButton
|
||||||
toggled: !root.showBreadcrumb
|
toggled: !root.showBreadcrumb
|
||||||
onClicked: root.showBreadcrumb = !root.showBreadcrumb
|
downAction: () => root.showBreadcrumb = !root.showBreadcrumb
|
||||||
contentItem: MaterialSymbol {
|
contentItem: MaterialSymbol {
|
||||||
text: "edit"
|
text: "edit"
|
||||||
iconSize: Appearance.font.pixelSize.larger
|
iconSize: Appearance.font.pixelSize.larger
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ RippleButton {
|
|||||||
implicitWidth: 40
|
implicitWidth: 40
|
||||||
implicitHeight: 40
|
implicitHeight: 40
|
||||||
Layout.leftMargin: 8
|
Layout.leftMargin: 8
|
||||||
onClicked: {
|
downAction: () => {
|
||||||
parent.expanded = !parent.expanded;
|
parent.expanded = !parent.expanded;
|
||||||
}
|
}
|
||||||
buttonRadius: Appearance.rounding.full
|
buttonRadius: Appearance.rounding.full
|
||||||
|
|||||||
@@ -32,7 +32,8 @@ TabButton {
|
|||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onPressed: (event) => {
|
onPressed: (event) => {
|
||||||
|
button.click() // Because the MouseArea already consumed the event
|
||||||
const {x,y} = event
|
const {x,y} = event
|
||||||
const stateY = buttonBackground.y;
|
const stateY = buttonBackground.y;
|
||||||
rippleAnim.x = x;
|
rippleAnim.x = x;
|
||||||
@@ -46,7 +47,6 @@ TabButton {
|
|||||||
rippleAnim.restart();
|
rippleAnim.restart();
|
||||||
}
|
}
|
||||||
onReleased: (event) => {
|
onReleased: (event) => {
|
||||||
button.click() // Because the MouseArea already consumed the event
|
|
||||||
rippleFadeAnim.restart();
|
rippleFadeAnim.restart();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,8 @@ TabButton {
|
|||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onPressed: (event) => {
|
onPressed: (event) => {
|
||||||
|
root.click() // Because the MouseArea already consumed the event
|
||||||
const {x,y} = event
|
const {x,y} = event
|
||||||
const stateY = buttonBackground.y;
|
const stateY = buttonBackground.y;
|
||||||
rippleAnim.x = x;
|
rippleAnim.x = x;
|
||||||
@@ -44,7 +45,6 @@ TabButton {
|
|||||||
rippleAnim.restart();
|
rippleAnim.restart();
|
||||||
}
|
}
|
||||||
onReleased: (event) => {
|
onReleased: (event) => {
|
||||||
root.click() // Because the MouseArea already consumed the event
|
|
||||||
rippleFadeAnim.restart();
|
rippleFadeAnim.restart();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ Item { // Player instance
|
|||||||
}
|
}
|
||||||
TrackChangeButton {
|
TrackChangeButton {
|
||||||
iconName: "skip_previous"
|
iconName: "skip_previous"
|
||||||
onClicked: root.player?.previous()
|
downAction: () => root.player?.previous()
|
||||||
}
|
}
|
||||||
Item {
|
Item {
|
||||||
id: progressBarContainer
|
id: progressBarContainer
|
||||||
@@ -277,7 +277,7 @@ Item { // Player instance
|
|||||||
}
|
}
|
||||||
TrackChangeButton {
|
TrackChangeButton {
|
||||||
iconName: "skip_next"
|
iconName: "skip_next"
|
||||||
onClicked: root.player?.next()
|
downAction: () => root.player?.next()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -289,7 +289,7 @@ Item { // Player instance
|
|||||||
property real size: 44
|
property real size: 44
|
||||||
implicitWidth: size
|
implicitWidth: size
|
||||||
implicitHeight: size
|
implicitHeight: size
|
||||||
onClicked: root.player.togglePlaying();
|
downAction: () => root.player.togglePlaying();
|
||||||
|
|
||||||
buttonRadius: root.player?.isPlaying ? Appearance?.rounding.normal : size / 2
|
buttonRadius: root.player?.isPlaying ? Appearance?.rounding.normal : size / 2
|
||||||
colBackground: root.player?.isPlaying ? blendedColors.colPrimary : blendedColors.colSecondaryContainer
|
colBackground: root.player?.isPlaying ? blendedColors.colPrimary : blendedColors.colSecondaryContainer
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ Scope { // Scope
|
|||||||
baseWidth: 40
|
baseWidth: 40
|
||||||
baseHeight: 40
|
baseHeight: 40
|
||||||
clickedWidth: baseWidth
|
clickedWidth: baseWidth
|
||||||
clickedHeight: baseHeight + 20
|
clickedHeight: baseHeight + 10
|
||||||
buttonRadius: Appearance.rounding.normal
|
buttonRadius: Appearance.rounding.normal
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ Scope { // Scope
|
|||||||
VerticalButtonGroup {
|
VerticalButtonGroup {
|
||||||
OskControlButton { // Pin button
|
OskControlButton { // Pin button
|
||||||
toggled: root.pinned
|
toggled: root.pinned
|
||||||
onClicked: root.pinned = !root.pinned
|
downAction: () => root.pinned = !root.pinned
|
||||||
contentItem: MaterialSymbol {
|
contentItem: MaterialSymbol {
|
||||||
text: "keep"
|
text: "keep"
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ Item {
|
|||||||
id: workspaceArea
|
id: workspaceArea
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
acceptedButtons: Qt.LeftButton
|
acceptedButtons: Qt.LeftButton
|
||||||
onClicked: {
|
onPressed: {
|
||||||
if (root.draggingTargetWorkspace === -1) {
|
if (root.draggingTargetWorkspace === -1) {
|
||||||
GlobalStates.overviewOpen = false
|
GlobalStates.overviewOpen = false
|
||||||
Hyprland.dispatch(`workspace ${workspaceValue}`)
|
Hyprland.dispatch(`workspace ${workspaceValue}`)
|
||||||
|
|||||||
@@ -757,8 +757,8 @@ Inline w/ backslash and round brackets \\(e^{i\\pi} + 1 = 0\\)
|
|||||||
delegate: ApiCommandButton {
|
delegate: ApiCommandButton {
|
||||||
property string commandRepresentation: `${root.commandPrefix}${modelData.name}`
|
property string commandRepresentation: `${root.commandPrefix}${modelData.name}`
|
||||||
buttonText: commandRepresentation
|
buttonText: commandRepresentation
|
||||||
onClicked: {
|
downAction: () => {
|
||||||
if(modelData.sendDirectly) {
|
if (modelData.sendDirectly) {
|
||||||
root.handleInput(commandRepresentation)
|
root.handleInput(commandRepresentation)
|
||||||
} else {
|
} else {
|
||||||
messageInputField.text = commandRepresentation + (modelData.dontAddSpace ? "" : " ")
|
messageInputField.text = commandRepresentation + (modelData.dontAddSpace ? "" : " ")
|
||||||
|
|||||||
@@ -525,9 +525,10 @@ Item {
|
|||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
PointingHandInteraction {}
|
PointingHandInteraction {}
|
||||||
onClicked: {
|
onPressed: {
|
||||||
nsfwSwitch.checked = !nsfwSwitch.checked
|
nsfwSwitch.checked = !nsfwSwitch.checked
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -566,8 +567,8 @@ Item {
|
|||||||
buttonText: commandRepresentation
|
buttonText: commandRepresentation
|
||||||
colBackground: Appearance.colors.colLayer2
|
colBackground: Appearance.colors.colLayer2
|
||||||
|
|
||||||
onClicked: {
|
downAction: () => {
|
||||||
if(modelData.sendDirectly) {
|
if (modelData.sendDirectly) {
|
||||||
root.handleInput(commandRepresentation)
|
root.handleInput(commandRepresentation)
|
||||||
} else {
|
} else {
|
||||||
tagInputField.text = commandRepresentation + " "
|
tagInputField.text = commandRepresentation + " "
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ GroupButton {
|
|||||||
verticalPadding: 6
|
verticalPadding: 6
|
||||||
|
|
||||||
baseWidth: contentItem.implicitWidth + horizontalPadding * 2
|
baseWidth: contentItem.implicitWidth + horizontalPadding * 2
|
||||||
clickedWidth: baseWidth + 20
|
clickedWidth: baseWidth + 14
|
||||||
baseHeight: contentItem.implicitHeight + verticalPadding * 2
|
baseHeight: contentItem.implicitHeight + verticalPadding * 2
|
||||||
buttonRadius: down ? Appearance.rounding.verysmall : Appearance.rounding.small
|
buttonRadius: down ? Appearance.rounding.verysmall : Appearance.rounding.small
|
||||||
|
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ Rectangle {
|
|||||||
Layout.margins: 10
|
Layout.margins: 10
|
||||||
Layout.rightMargin: 0
|
Layout.rightMargin: 0
|
||||||
forceCircle: true
|
forceCircle: true
|
||||||
onClicked: {
|
downAction: () => {
|
||||||
root.setCollapsed(false)
|
root.setCollapsed(false)
|
||||||
}
|
}
|
||||||
contentItem: MaterialSymbol {
|
contentItem: MaterialSymbol {
|
||||||
@@ -146,7 +146,7 @@ Rectangle {
|
|||||||
toggled: root.selectedTab == index
|
toggled: root.selectedTab == index
|
||||||
buttonText: modelData.name
|
buttonText: modelData.name
|
||||||
buttonIcon: modelData.icon
|
buttonIcon: modelData.icon
|
||||||
onClicked: {
|
onPressed: {
|
||||||
root.selectedTab = index
|
root.selectedTab = index
|
||||||
Persistent.states.sidebar.bottomGroup.tab = index
|
Persistent.states.sidebar.bottomGroup.tab = index
|
||||||
}
|
}
|
||||||
@@ -158,7 +158,7 @@ Rectangle {
|
|||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
forceCircle: true
|
forceCircle: true
|
||||||
onClicked: {
|
downAction: () => {
|
||||||
root.setCollapsed(true)
|
root.setCollapsed(true)
|
||||||
}
|
}
|
||||||
contentItem: MaterialSymbol {
|
contentItem: MaterialSymbol {
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ Item {
|
|||||||
clip: true
|
clip: true
|
||||||
buttonText: `${monthShift != 0 ? "• " : ""}${viewingDate.toLocaleDateString(Qt.locale(), "MMMM yyyy")}`
|
buttonText: `${monthShift != 0 ? "• " : ""}${viewingDate.toLocaleDateString(Qt.locale(), "MMMM yyyy")}`
|
||||||
tooltipText: (monthShift === 0) ? "" : Translation.tr("Jump to current month")
|
tooltipText: (monthShift === 0) ? "" : Translation.tr("Jump to current month")
|
||||||
onClicked: {
|
downAction: () => {
|
||||||
monthShift = 0;
|
monthShift = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -60,7 +60,7 @@ Item {
|
|||||||
}
|
}
|
||||||
CalendarHeaderButton {
|
CalendarHeaderButton {
|
||||||
forceCircle: true
|
forceCircle: true
|
||||||
onClicked: {
|
downAction: () => {
|
||||||
monthShift--;
|
monthShift--;
|
||||||
}
|
}
|
||||||
contentItem: MaterialSymbol {
|
contentItem: MaterialSymbol {
|
||||||
@@ -72,7 +72,7 @@ Item {
|
|||||||
}
|
}
|
||||||
CalendarHeaderButton {
|
CalendarHeaderButton {
|
||||||
forceCircle: true
|
forceCircle: true
|
||||||
onClicked: {
|
downAction: () => {
|
||||||
monthShift++;
|
monthShift++;
|
||||||
}
|
}
|
||||||
contentItem: MaterialSymbol {
|
contentItem: MaterialSymbol {
|
||||||
|
|||||||
@@ -109,12 +109,12 @@ Item {
|
|||||||
AudioDeviceSelectorButton {
|
AudioDeviceSelectorButton {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
input: false
|
input: false
|
||||||
onClicked: root.showDeviceSelectorDialog(input)
|
downAction: () => root.showDeviceSelectorDialog(input)
|
||||||
}
|
}
|
||||||
AudioDeviceSelectorButton {
|
AudioDeviceSelectorButton {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
input: true
|
input: true
|
||||||
onClicked: root.showDeviceSelectorDialog(input)
|
downAction: () => root.showDeviceSelectorDialog(input)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ ApplicationWindow {
|
|||||||
iconText: "edit"
|
iconText: "edit"
|
||||||
buttonText: Translation.tr("Config file")
|
buttonText: Translation.tr("Config file")
|
||||||
expanded: navRail.expanded
|
expanded: navRail.expanded
|
||||||
onClicked: {
|
downAction: () => {
|
||||||
Qt.openUrlExternally(`${Directories.config}/illogical-impulse/config.json`);
|
Qt.openUrlExternally(`${Directories.config}/illogical-impulse/config.json`);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,7 +190,7 @@ ApplicationWindow {
|
|||||||
required property var index
|
required property var index
|
||||||
required property var modelData
|
required property var modelData
|
||||||
toggled: root.currentPage === index
|
toggled: root.currentPage === index
|
||||||
onClicked: root.currentPage = index;
|
onPressed: root.currentPage = index;
|
||||||
expanded: navRail.expanded
|
expanded: navRail.expanded
|
||||||
buttonIcon: modelData.icon
|
buttonIcon: modelData.icon
|
||||||
buttonIconRotation: modelData.iconRotation || 0
|
buttonIconRotation: modelData.iconRotation || 0
|
||||||
|
|||||||
Reference in New Issue
Block a user