replace MouseArea with HoverHandler+TapHandler in BT/network menu delegates

This commit is contained in:
Damocles 2026-04-15 14:23:42 +02:00
parent 6eb36b86c9
commit 1184cdd488
2 changed files with 24 additions and 24 deletions

View file

@ -73,7 +73,7 @@ M.HoverPanel {
anchors.fill: parent anchors.fill: parent
anchors.leftMargin: 4 anchors.leftMargin: 4
anchors.rightMargin: 4 anchors.rightMargin: 4
color: btHeaderArea.containsMouse ? M.Theme.base02 : "transparent" color: btHeaderHover.hovered ? M.Theme.base02 : "transparent"
radius: M.Theme.radius radius: M.Theme.radius
} }
@ -109,12 +109,12 @@ M.HoverPanel {
font.family: M.Theme.iconFontFamily font.family: M.Theme.iconFontFamily
} }
MouseArea { HoverHandler {
id: btHeaderArea id: btHeaderHover
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: { }
TapHandler {
onTapped: {
powerProc._action = menuWindow._btEnabled ? "off" : "on"; powerProc._action = menuWindow._btEnabled ? "off" : "on";
powerProc.running = true; powerProc.running = true;
} }
@ -143,7 +143,7 @@ M.HoverPanel {
anchors.fill: parent anchors.fill: parent
anchors.leftMargin: 4 anchors.leftMargin: 4
anchors.rightMargin: 4 anchors.rightMargin: 4
color: entryArea.containsMouse ? M.Theme.base02 : "transparent" color: entryHover.hovered ? M.Theme.base02 : "transparent"
radius: M.Theme.radius radius: M.Theme.radius
} }
@ -184,12 +184,12 @@ M.HoverPanel {
width: entry.modelData.battery >= 0 ? implicitWidth : 0 width: entry.modelData.battery >= 0 ? implicitWidth : 0
} }
MouseArea { HoverHandler {
id: entryArea id: entryHover
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: { }
TapHandler {
onTapped: {
toggleProc.action = entry.modelData.connected ? "disconnect" : "connect"; toggleProc.action = entry.modelData.connected ? "disconnect" : "connect";
toggleProc.mac = entry.modelData.mac; toggleProc.mac = entry.modelData.mac;
toggleProc.running = true; toggleProc.running = true;

View file

@ -104,7 +104,7 @@ M.HoverPanel {
anchors.fill: parent anchors.fill: parent
anchors.leftMargin: 4 anchors.leftMargin: 4
anchors.rightMargin: 4 anchors.rightMargin: 4
color: headerArea.containsMouse ? M.Theme.base02 : "transparent" color: headerHover.hovered ? M.Theme.base02 : "transparent"
radius: M.Theme.radius radius: M.Theme.radius
} }
@ -140,12 +140,12 @@ M.HoverPanel {
font.family: M.Theme.iconFontFamily font.family: M.Theme.iconFontFamily
} }
MouseArea { HoverHandler {
id: headerArea id: headerHover
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: { }
TapHandler {
onTapped: {
radioProc._state = menuWindow._wifiEnabled ? "off" : "on"; radioProc._state = menuWindow._wifiEnabled ? "off" : "on";
radioProc.running = true; radioProc.running = true;
} }
@ -174,7 +174,7 @@ M.HoverPanel {
anchors.fill: parent anchors.fill: parent
anchors.leftMargin: 4 anchors.leftMargin: 4
anchors.rightMargin: 4 anchors.rightMargin: 4
color: entryArea.containsMouse ? M.Theme.base02 : "transparent" color: entryHover.hovered ? M.Theme.base02 : "transparent"
radius: M.Theme.radius radius: M.Theme.radius
} }
@ -215,12 +215,12 @@ M.HoverPanel {
width: entry.modelData.signal >= 0 ? implicitWidth : 0 width: entry.modelData.signal >= 0 ? implicitWidth : 0
} }
MouseArea { HoverHandler {
id: entryArea id: entryHover
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: { }
TapHandler {
onTapped: {
if (entry.modelData.active) { if (entry.modelData.active) {
disconnectProc.uuid = entry.modelData.uuid; disconnectProc.uuid = entry.modelData.uuid;
disconnectProc.running = true; disconnectProc.running = true;