add option to open tooltips by pressing the mouse button

This commit is contained in:
Firmino Veras
2025-11-14 09:55:06 -03:00
parent 4b8f294a91
commit 2ccdf3b751
10 changed files with 34 additions and 15 deletions
@@ -16,7 +16,7 @@ MouseArea {
implicitWidth: batteryProgress.implicitWidth
implicitHeight: Appearance.sizes.barHeight
hoverEnabled: true
hoverEnabled: !Config.options.bar.tooltips.clickToShow
ClippedProgressBar {
id: batteryProgress
@@ -40,8 +40,7 @@ Item {
MouseArea {
id: mouseArea
anchors.fill: parent
hoverEnabled: true
acceptedButtons: Qt.NoButton
hoverEnabled: !Config.options.bar.tooltips.clickToShow
ClockWidgetPopup {
hoverTarget: mouseArea
@@ -9,7 +9,7 @@ MouseArea {
property bool alwaysShowAllResources: false
implicitWidth: rowLayout.implicitWidth + rowLayout.anchors.leftMargin + rowLayout.anchors.rightMargin
implicitHeight: Appearance.sizes.barHeight
hoverEnabled: true
hoverEnabled: !Config.options.bar.tooltips.clickToShow
RowLayout {
id: rowLayout
@@ -13,15 +13,19 @@ MouseArea {
implicitWidth: rowLayout.implicitWidth + 10 * 2
implicitHeight: Appearance.sizes.barHeight
hoverEnabled: true
acceptedButtons: Qt.LeftButton | Qt.RightButton
hoverEnabled: !Config.options.bar.tooltips.clickToShow
onPressed: {
Weather.getData();
Quickshell.execDetached(["notify-send",
Translation.tr("Weather"),
Translation.tr("Refreshing (manually triggered)")
, "-a", "Shell"
])
if (mouse.button === Qt.RightButton) {
Weather.getData();
Quickshell.execDetached(["notify-send",
Translation.tr("Weather"),
Translation.tr("Refreshing (manually triggered)")
, "-a", "Shell"
])
mouse.accepted = false
}
}
RowLayout {