Fix Account Switcher Missing Clicks
Use a state machine to open and close the account switcher so clicks aren't missed. BUG: 462549
This commit is contained in:
@@ -15,7 +15,6 @@ QQC2.ToolBar {
|
|||||||
|
|
||||||
height: content.height
|
height: content.height
|
||||||
|
|
||||||
property alias accountsListVisible: accounts.visible
|
|
||||||
property var addAccount
|
property var addAccount
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
@@ -59,7 +58,9 @@ QQC2.ToolBar {
|
|||||||
subtitle: i18n("Log in to an existing account")
|
subtitle: i18n("Log in to an existing account")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
pageStack.pushDialogLayer("qrc:/WelcomePage.qml", {}, {title: i18nc("@title:window", "Login")})
|
pageStack.pushDialogLayer("qrc:/WelcomePage.qml", {}, {title: i18nc("@title:window", "Login")})
|
||||||
userInfo.accountsListVisible = false
|
if (switchUserButton.checked) {
|
||||||
|
switchUserButton.checked = false
|
||||||
|
}
|
||||||
accounts.currentIndex = Controller.activeConnectionIndex
|
accounts.currentIndex = Controller.activeConnectionIndex
|
||||||
}
|
}
|
||||||
Keys.onUpPressed: {
|
Keys.onUpPressed: {
|
||||||
@@ -72,7 +73,7 @@ QQC2.ToolBar {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
visible: false
|
visible: switchUserButton.checked
|
||||||
onVisibleChanged: if (visible) focus = true
|
onVisibleChanged: if (visible) focus = true
|
||||||
clip: true
|
clip: true
|
||||||
model: AccountRegistry
|
model: AccountRegistry
|
||||||
@@ -96,7 +97,9 @@ QQC2.ToolBar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Keys.onReleased: if (event.key == Qt.Key_Escape) {
|
Keys.onReleased: if (event.key == Qt.Key_Escape) {
|
||||||
userInfo.accountsListVisible = false
|
if (switchUserButton.checked) {
|
||||||
|
switchUserButton.checked = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
width: parent.width
|
width: parent.width
|
||||||
@@ -116,7 +119,9 @@ QQC2.ToolBar {
|
|||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
Controller.activeConnection = model.connection
|
Controller.activeConnection = model.connection
|
||||||
userInfo.accountsListVisible = false
|
if (switchUserButton.checked) {
|
||||||
|
switchUserButton.checked = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -167,10 +172,9 @@ QQC2.ToolBar {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
QQC2.ToolButton {
|
QQC2.ToolButton {
|
||||||
|
id: switchUserButton
|
||||||
icon.name: "system-switch-user"
|
icon.name: "system-switch-user"
|
||||||
onClicked: {
|
checkable: true
|
||||||
userInfo.accountsListVisible = !userInfo.accountsListVisible
|
|
||||||
}
|
|
||||||
text: i18n("Switch User")
|
text: i18n("Switch User")
|
||||||
display: QQC2.AbstractButton.IconOnly
|
display: QQC2.AbstractButton.IconOnly
|
||||||
Accessible.name: text
|
Accessible.name: text
|
||||||
|
|||||||
Reference in New Issue
Block a user