Skip to content

Commit

Permalink
#55: mouse handlers added to spacers
Browse files Browse the repository at this point in the history
  • Loading branch information
antroids committed Sep 27, 2024
1 parent 2a8226f commit 9f4d83a
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 43 deletions.
40 changes: 40 additions & 0 deletions package/contents/ui/MouseHandlers.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* SPDX-FileCopyrightText: 2024 Anton Kharuzhy <[email protected]>
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/

import QtQuick

Item {
id: handlers
anchors.fill: parent

signal invokeKWinShortcut(string shortcut)

WidgetDragHandler {
Component.onCompleted: {
invokeKWinShortcut.connect(handlers.invokeKWinShortcut);
}
}

WidgetTapHandler {
Component.onCompleted: {
invokeKWinShortcut.connect(handlers.invokeKWinShortcut);
}
}

WidgetWheelHandler {
orientation: Qt.Vertical
Component.onCompleted: {
invokeKWinShortcut.connect(handlers.invokeKWinShortcut);
}
}

WidgetWheelHandler {
orientation: Qt.Horizontal
Component.onCompleted: {
invokeKWinShortcut.connect(handlers.invokeKWinShortcut);
}
}
}
50 changes: 8 additions & 42 deletions package/contents/ui/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -134,27 +134,7 @@ PlasmoidItem {
source: tasksModel.activeWindow.icon || "window"
enabled: tasksModel.hasActiveWindow && !!tasksModel.activeWindow.icon

WidgetDragHandler {
Component.onCompleted: {
invokeKWinShortcut.connect(root.invokeKWinShortcut);
}
}

WidgetTapHandler {
Component.onCompleted: {
invokeKWinShortcut.connect(root.invokeKWinShortcut);
}
}

WidgetWheelHandler {
orientation: Qt.Vertical
Component.onCompleted: {
invokeKWinShortcut.connect(root.invokeKWinShortcut);
}
}

WidgetWheelHandler {
orientation: Qt.Horizontal
MouseHandlers {
Component.onCompleted: {
invokeKWinShortcut.connect(root.invokeKWinShortcut);
}
Expand All @@ -174,6 +154,12 @@ PlasmoidItem {
Layout.preferredWidth: width
color: "transparent"
enabled: tasksModel.hasActiveWindow

MouseHandlers {
Component.onCompleted: {
invokeKWinShortcut.connect(root.invokeKWinShortcut);
}
}
}
}

Expand Down Expand Up @@ -241,27 +227,7 @@ PlasmoidItem {

Component.onCompleted: updateTitleTextReplacements()

WidgetDragHandler {
Component.onCompleted: {
invokeKWinShortcut.connect(root.invokeKWinShortcut);
}
}

WidgetTapHandler {
Component.onCompleted: {
invokeKWinShortcut.connect(root.invokeKWinShortcut);
}
}

WidgetWheelHandler {
orientation: Qt.Vertical
Component.onCompleted: {
invokeKWinShortcut.connect(root.invokeKWinShortcut);
}
}

WidgetWheelHandler {
orientation: Qt.Horizontal
MouseHandlers {
Component.onCompleted: {
invokeKWinShortcut.connect(root.invokeKWinShortcut);
}
Expand Down
2 changes: 1 addition & 1 deletion package/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"Id": "com.github.antroids.application-title-bar",
"Name": "Application Title Bar",
"License": "GPL-3.0+",
"Version": "0.7.3",
"Version": "0.7.4",
"Website": "https://github.com/antroids/application-title-bar",
"FormFactors": [
"desktop"
Expand Down

0 comments on commit 9f4d83a

Please sign in to comment.