[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 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 * A model with a list of users to show in the view
* The following roles should exist: * The following roles should exist:

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

Loading…
Cancel
Save