diff --git a/tailscalectl/TailscaleWidget.qml b/tailscalectl/TailscaleWidget.qml index 37d8330..24aac11 100644 --- a/tailscalectl/TailscaleWidget.qml +++ b/tailscalectl/TailscaleWidget.qml @@ -133,26 +133,20 @@ PluginComponent { } horizontalBarPill: Component { - MouseArea { - implicitWidth: contentRow.implicitWidth - implicitHeight: contentRow.implicitHeight - cursorShape: Qt.PointingHandCursor - acceptedButtons: Qt.RightButton | Qt.LeftButton - propagateComposedEvents: true - onClicked: (mouse) => { - if (mouse.button === Qt.RightButton) { - toggleTailscale() - mouse.accepted = true - } else { - mouse.accepted = false - } - } + Row { + id: contentRow + spacing: Theme.spacingS - Row { - id: contentRow - spacing: Theme.spacingS + MouseArea { + cursorShape: Qt.PointingHandCursor + acceptedButtons: Qt.RightButton + anchors.verticalCenter: parent.verticalCenter + width: hIcon.implicitWidth + height: hIcon.implicitHeight + onClicked: toggleTailscale() DankIcon { + id: hIcon name: root.isConnected ? "vpn_key" : "vpn_key_off" size: Theme.iconSize color: root.isConnected ? Theme.primary : Theme.surfaceText @@ -163,26 +157,20 @@ PluginComponent { } verticalBarPill: Component { - MouseArea { - implicitWidth: contentColumn.implicitWidth - implicitHeight: contentColumn.implicitHeight - cursorShape: Qt.PointingHandCursor - acceptedButtons: Qt.RightButton | Qt.LeftButton - propagateComposedEvents: true - onClicked: (mouse) => { - if (mouse.button === Qt.RightButton) { - toggleTailscale() - mouse.accepted = true - } else { - mouse.accepted = false - } - } + Column { + id: contentColumn + spacing: Theme.spacingXS - Column { - id: contentColumn - spacing: Theme.spacingXS + MouseArea { + cursorShape: Qt.PointingHandCursor + acceptedButtons: Qt.RightButton + anchors.horizontalCenter: parent.horizontalCenter + width: vIcon.implicitWidth + height: vIcon.implicitHeight + onClicked: toggleTailscale() DankIcon { + id: vIcon name: root.isConnected ? "vpn_key" : "vpn_key_off" size: Theme.iconSize color: root.isConnected ? Theme.primary : Theme.surfaceText