Commit 45b86d56 authored by Ming Rui Zhang's avatar Ming Rui Zhang Committed by Sébastien Blin
Browse files

shortcut: fix settings menu selection shortcut

Change-Id: I19cab014fc119ae0fe0b3e742d1ec59ca8dfadc3
parent da18924f
......@@ -479,7 +479,7 @@ Rectangle {
if (!inSettingsView) {
toggleSettingsView()
}
settingsMenu.btnMediaSettings.clicked()
settingsMenu.buttonSelectedManually(SettingsView.Media)
}
}
......@@ -490,7 +490,7 @@ Rectangle {
if (!inSettingsView) {
toggleSettingsView()
}
settingsMenu.btnGeneralSettings.clicked()
settingsMenu.buttonSelectedManually(SettingsView.General)
}
}
......@@ -501,7 +501,7 @@ Rectangle {
if (!inSettingsView) {
toggleSettingsView()
}
settingsMenu.btnAccountSettings.clicked()
settingsMenu.buttonSelectedManually(SettingsView.Account)
}
}
......@@ -512,7 +512,7 @@ Rectangle {
if (!inSettingsView) {
toggleSettingsView()
}
settingsMenu.btnPluginSettings.clicked()
settingsMenu.buttonSelectedManually(SettingsView.Plugin)
}
}
......
......@@ -30,6 +30,7 @@ Rectangle {
id: root
signal itemSelected(int index)
signal buttonSelectedManually(int index)
Component.onCompleted: {
listModel.append({ 'type': SettingsView.Account, 'name': JamiStrings.accountSettingsMenuTitle,
......@@ -46,6 +47,8 @@ Rectangle {
color: JamiTheme.backgroundColor
ButtonGroup {
id: buttonGroup
buttons: buttons.children
onCheckedButtonChanged: itemSelected(checkedButton.menuType)
}
......@@ -64,8 +67,19 @@ Rectangle {
model: ListModel { id: listModel }
PushButton {
id: pushButton
property int menuType: type
Connections {
target: root
function onButtonSelectedManually(index) {
if (pushButton.menuType === index)
buttonGroup.checkedButton = pushButton
}
}
Component.onCompleted: checked = type === SettingsView.Account
preferredHeight: 64
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment