Skip to content

Commit

Permalink
Enable using double click to connect to/disconnect from servers.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr-Incognito committed Jun 19, 2020
1 parent f73328e commit 7994927
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/ui/servers.qml
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,11 @@ ColumnLayout {
}
background: MouseArea {
anchors.fill: parent
acceptedButtons: Qt.RightButton
onClicked: function() {
acceptedButtons: Qt.LeftButton | Qt.RightButton
onClicked: function(mouse) {
if (mouse.button !== Qt.RightButton) {
return
}
var serverName = parent.parent.data[0].text,
isConnected = parent.parent.data[3].text === qsTr("Connected")

Expand All @@ -148,6 +151,15 @@ ColumnLayout {
menuItemConnect.text = isConnected ? qsTr("Disconnect") : qsTr("Connect")
menuServer.open()
}
onDoubleClicked: function(mouse) {
if (mouse.button !== Qt.LeftButton) {
return
}
var serverName = parent.parent.data[0].text,
isConnected = parent.parent.data[3].text === qsTr("Connected")

AppProxy.setServerConnection(serverName, !isConnected)
}
}
}
}
Expand Down

0 comments on commit 7994927

Please sign in to comment.