fix(tailscalectl): let PluginComponent handle left-click for popout

This commit is contained in:
Vybe (Coding Agent) 2026-05-17 21:18:02 +00:00
parent c3f63873ac
commit 821ede2bea

View file

@ -133,26 +133,20 @@ PluginComponent {
} }
horizontalBarPill: Component { 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 { Row {
id: contentRow id: contentRow
spacing: Theme.spacingS spacing: Theme.spacingS
MouseArea {
cursorShape: Qt.PointingHandCursor
acceptedButtons: Qt.RightButton
anchors.verticalCenter: parent.verticalCenter
width: hIcon.implicitWidth
height: hIcon.implicitHeight
onClicked: toggleTailscale()
DankIcon { DankIcon {
id: hIcon
name: root.isConnected ? "vpn_key" : "vpn_key_off" name: root.isConnected ? "vpn_key" : "vpn_key_off"
size: Theme.iconSize size: Theme.iconSize
color: root.isConnected ? Theme.primary : Theme.surfaceText color: root.isConnected ? Theme.primary : Theme.surfaceText
@ -163,26 +157,20 @@ PluginComponent {
} }
verticalBarPill: Component { 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 { Column {
id: contentColumn id: contentColumn
spacing: Theme.spacingXS spacing: Theme.spacingXS
MouseArea {
cursorShape: Qt.PointingHandCursor
acceptedButtons: Qt.RightButton
anchors.horizontalCenter: parent.horizontalCenter
width: vIcon.implicitWidth
height: vIcon.implicitHeight
onClicked: toggleTailscale()
DankIcon { DankIcon {
id: vIcon
name: root.isConnected ? "vpn_key" : "vpn_key_off" name: root.isConnected ? "vpn_key" : "vpn_key_off"
size: Theme.iconSize size: Theme.iconSize
color: root.isConnected ? Theme.primary : Theme.surfaceText color: root.isConnected ? Theme.primary : Theme.surfaceText