[sddm-theme,lookandfeel] Factor out action items' visibility

wilder-5.25
ivan tkachenko 4 years ago
parent 2d0ac6ea04
commit ae77a5b5d2
  1. 5
      lookandfeel/contents/components/SessionManagementScreen.qml
  2. 11
      sddm-theme/Main.qml

@ -25,6 +25,11 @@ FocusScope {
*/
property alias actionItems: actionItemsLayout.children
/*
* Whether to show or hide the list of action items as a whole.
*/
property alias actionItemsVisible: actionItemsLayout.visible
/*
* A model with a list of users to show in the view
* The following roles should exist:

@ -202,6 +202,7 @@ PlasmaCore.ColorScope {
return text
}
actionItemsVisible: !inputPanel.keyboardActive
actionItems: [
ActionButton {
iconSource: "system-suspend"
@ -209,7 +210,6 @@ PlasmaCore.ColorScope {
fontSize: parseInt(config.fontSize) + 1
onClicked: sddm.suspend()
enabled: sddm.canSuspend
visible: !inputPanel.keyboardActive
},
ActionButton {
iconSource: "system-reboot"
@ -217,7 +217,6 @@ PlasmaCore.ColorScope {
fontSize: parseInt(config.fontSize) + 1
onClicked: sddm.reboot()
enabled: sddm.canReboot
visible: !inputPanel.keyboardActive
},
ActionButton {
iconSource: "system-shutdown"
@ -225,7 +224,6 @@ PlasmaCore.ColorScope {
fontSize: parseInt(config.fontSize) + 1
onClicked: sddm.powerOff()
enabled: sddm.canPowerOff
visible: !inputPanel.keyboardActive
},
ActionButton {
iconSource: "system-user-prompt"
@ -233,7 +231,7 @@ PlasmaCore.ColorScope {
fontSize: parseInt(config.fontSize) + 1
onClicked: mainStack.push(userPromptComponent)
enabled: true
visible: !userListComponent.showUsernamePrompt && !inputPanel.keyboardActive
visible: !userListComponent.showUsernamePrompt
}]
onLoginRequest: {
@ -453,6 +451,7 @@ PlasmaCore.ColorScope {
sddm.login(username, password, sessionButton.currentIndex)
}
actionItemsVisible: !inputPanel.keyboardActive
actionItems: [
ActionButton {
iconSource: "system-suspend"
@ -460,7 +459,6 @@ PlasmaCore.ColorScope {
fontSize: parseInt(config.fontSize) + 1
onClicked: sddm.suspend()
enabled: sddm.canSuspend
visible: !inputPanel.keyboardActive
},
ActionButton {
iconSource: "system-reboot"
@ -468,7 +466,6 @@ PlasmaCore.ColorScope {
fontSize: parseInt(config.fontSize) + 1
onClicked: sddm.reboot()
enabled: sddm.canReboot
visible: !inputPanel.keyboardActive
},
ActionButton {
iconSource: "system-shutdown"
@ -476,14 +473,12 @@ PlasmaCore.ColorScope {
fontSize: parseInt(config.fontSize) + 1
onClicked: sddm.powerOff()
enabled: sddm.canPowerOff
visible: !inputPanel.keyboardActive
},
ActionButton {
iconSource: "system-user-list"
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "List Users")
fontSize: parseInt(config.fontSize) + 1
onClicked: mainStack.pop()
visible: !inputPanel.keyboardActive
}
]
}

Loading…
Cancel
Save