Fix all errors and warnings on login, lock, and logout screens

There were three principal sources of errors and warnings:
1. Un-ported `onFooChanged` statements
2. `config.fontSize` being unconditionally referenced from components
   without access to it (it comes from the SDDM config)
3. Accessing units from the context property rather than the singleton

All are fixed now. Tested with:
1. `sddm-greeter --test-mode --theme ~/kde/usr/share/sddm/themes/breeze/`
2. `~/kde/usr/lib64/libexec/kscreenlocker_greet --testing --theme ~/kde/src/plasma-workspace/lookandfeel`
3. `/kde/usr/lib64/libexec/ksmserver-logout-greeter --fakearg`

No regressions found.

BUG: 425349
FIXED-IN: 5.20
wilder-portage-prov
Nate Graham 6 years ago
parent 70a71393e5
commit bcaf3886d9
  1. 2
      components/workspace/BatteryIcon.qml
  2. 4
      lookandfeel/contents/components/ActionButton.qml
  3. 8
      lookandfeel/contents/components/Battery.qml
  4. 4
      lookandfeel/contents/components/KeyboardLayoutButton.qml
  5. 5
      lookandfeel/contents/components/SessionManagementScreen.qml
  6. 5
      lookandfeel/contents/components/UserDelegate.qml
  7. 3
      lookandfeel/contents/components/UserList.qml
  8. 2
      lookandfeel/contents/lockscreen/LockScreen.qml
  9. 10
      lookandfeel/contents/lockscreen/LockScreenUi.qml
  10. 2
      lookandfeel/contents/lockscreen/MainBlock.qml
  11. 1
      lookandfeel/contents/logout/Logout.qml
  12. 1
      sddm-theme/KeyboardButton.qml
  13. 2
      sddm-theme/Login.qml
  14. 22
      sddm-theme/Main.qml
  15. 2
      sddm-theme/SessionButton.qml

@ -39,7 +39,7 @@ Item {
PlasmaCore.SvgItem { PlasmaCore.SvgItem {
id: batterySvg id: batterySvg
anchors.centerIn: parent anchors.centerIn: parent
width: units.roundToIconSize(Math.min(parent.width, parent.height)) width: PlasmaCore.Units.roundToIconSize(Math.min(parent.width, parent.height))
height: width height: width
svg: svg svg: svg
elementId: "Battery" elementId: "Battery"

@ -30,7 +30,7 @@ Item {
property alias labelRendering: label.renderType property alias labelRendering: label.renderType
property alias circleOpacity: iconCircle.opacity property alias circleOpacity: iconCircle.opacity
property alias circleVisiblity: iconCircle.visible property alias circleVisiblity: iconCircle.visible
property int fontSize: config.fontSize property int fontSize: PlasmaCore.Theme.defaultFont.pointSize + 1
readonly property bool softwareRendering: GraphicsInfo.api === GraphicsInfo.Software readonly property bool softwareRendering: GraphicsInfo.api === GraphicsInfo.Software
signal clicked signal clicked
@ -96,7 +96,7 @@ Item {
PlasmaComponents3.Label { PlasmaComponents3.Label {
id: label id: label
font.pointSize: Math.max(fontSize + 1,theme.defaultFont.pointSize + 1) font.pointSize: root.fontSize
anchors { anchors {
top: icon.bottom top: icon.bottom
topMargin: (softwareRendering ? 1.5 : 1) * units.smallSpacing topMargin: (softwareRendering ? 1.5 : 1) * units.smallSpacing

@ -24,7 +24,11 @@ import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.plasma.workspace.components 2.0 as PW import org.kde.plasma.workspace.components 2.0 as PW
Row { Row {
spacing: units.smallSpacing id: row
property int fontSize: PlasmaCore.Theme.defaultFont.pointSize
spacing: PlasmaCore.Units.smallSpacing
visible: pmSource.data["Battery"]["Has Cumulative"] visible: pmSource.data["Battery"]["Has Cumulative"]
PlasmaCore.DataSource { PlasmaCore.DataSource {
@ -45,7 +49,7 @@ Row {
PlasmaComponents3.Label { PlasmaComponents3.Label {
id: batteryLabel id: batteryLabel
font.pointSize: config.fontSize font.pointSize: row.fontSize
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","%1%", battery.percent) text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","%1%", battery.percent)
Accessible.name: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Battery at %1%", battery.percent) Accessible.name: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Battery at %1%", battery.percent)
} }

@ -25,14 +25,10 @@ import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.plasma.workspace.keyboardlayout 1.0 import org.kde.plasma.workspace.keyboardlayout 1.0
PlasmaComponents3.ToolButton { PlasmaComponents3.ToolButton {
property int fontSize: config.fontSize
id: kbLayoutButton id: kbLayoutButton
icon.name: "input-keyboard" icon.name: "input-keyboard"
text: layout.currentLayoutDisplayName text: layout.currentLayoutDisplayName
font.pointSize: Math.max(fontSize,theme.defaultFont.pointSize)
Accessible.name: i18ndc("plasma_lookandfeel_org.kde.lookandfeel", "Button to change keyboard layout", "Switch layout") Accessible.name: i18ndc("plasma_lookandfeel_org.kde.lookandfeel", "Button to change keyboard layout", "Switch layout")

@ -61,7 +61,7 @@ Item {
property alias userList: userListView property alias userList: userListView
property int fontSize: config.fontSize property int fontSize: PlasmaCore.Theme.defaultFont.pointSize + 2
default property alias _children: innerLayout.children default property alias _children: innerLayout.children
@ -73,6 +73,7 @@ Item {
left: parent.left left: parent.left
right: parent.right right: parent.right
} }
fontSize: root.fontSize
} }
//goal is to show the prompts, in ~16 grid units high, then the action buttons //goal is to show the prompts, in ~16 grid units high, then the action buttons
@ -87,7 +88,7 @@ Item {
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
PlasmaComponents3.Label { PlasmaComponents3.Label {
id: notificationsLabel id: notificationsLabel
font.pointSize: Math.max(fontSize + 1,theme.defaultFont.pointSize + 1) font.pointSize: root.fontSize
Layout.maximumWidth: units.gridUnit * 16 Layout.maximumWidth: units.gridUnit * 16
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true Layout.fillWidth: true

@ -31,14 +31,13 @@ Item {
property bool isCurrent: true property bool isCurrent: true
readonly property var m: model
property string name property string name
property string userName property string userName
property string avatarPath property string avatarPath
property string iconSource property string iconSource
property bool constrainText: true property bool constrainText: true
property alias nameFontSize: usernameDelegate.font.pointSize property alias nameFontSize: usernameDelegate.font.pointSize
property int fontSize: config.fontSize property int fontSize: PlasmaCore.Theme.defaultFont.pointSize + 2
signal clicked() signal clicked()
property real faceSize: units.gridUnit * 7 property real faceSize: units.gridUnit * 7
@ -161,7 +160,7 @@ Item {
PlasmaComponents3.Label { PlasmaComponents3.Label {
id: usernameDelegate id: usernameDelegate
font.pointSize: Math.max(fontSize + 2,theme.defaultFont.pointSize + 2) font.pointSize: wrapper.fontSize
anchors { anchors {
bottom: parent.bottom bottom: parent.bottom
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter

@ -18,12 +18,14 @@
*/ */
import QtQuick 2.2 import QtQuick 2.2
import org.kde.plasma.core 2.0 as PlasmaCore
ListView { ListView {
id: view id: view
readonly property string selectedUser: currentItem ? currentItem.userName : "" readonly property string selectedUser: currentItem ? currentItem.userName : ""
readonly property int userItemWidth: units.gridUnit * 8 readonly property int userItemWidth: units.gridUnit * 8
readonly property int userItemHeight: units.gridUnit * 8 readonly property int userItemHeight: units.gridUnit * 8
property int fontSize: PlasmaCore.Theme.defaultFont.pointSize + 2
implicitHeight: userItemHeight implicitHeight: userItemHeight
@ -47,6 +49,7 @@ ListView {
delegate: UserDelegate { delegate: UserDelegate {
avatarPath: model.icon || "" avatarPath: model.icon || ""
iconSource: model.iconName || "user-identity" iconSource: model.iconName || "user-identity"
fontSize: view.fontSize
name: { name: {
var displayName = model.realName || model.name var displayName = model.realName || model.name

@ -52,7 +52,7 @@ Item {
Connections { Connections {
id:loaderConnection id:loaderConnection
target: org_kde_plasma_screenlocker_greeter_view target: org_kde_plasma_screenlocker_greeter_view
onFrameSwapped: { function onFrameSwapped() {
mainLoader.source = "LockScreenUi.qml"; mainLoader.source = "LockScreenUi.qml";
loaderConnection.target = null; loaderConnection.target = null;
} }

@ -40,19 +40,19 @@ PlasmaCore.ColorScope {
Connections { Connections {
target: authenticator target: authenticator
onFailed: { function onFailed() {
root.notification = i18nd("plasma_lookandfeel_org.kde.lookandfeel","Unlocking failed"); root.notification = i18nd("plasma_lookandfeel_org.kde.lookandfeel","Unlocking failed");
} }
onGraceLockedChanged: { function onGraceLockedChanged() {
if (!authenticator.graceLocked) { if (!authenticator.graceLocked) {
root.notification = ""; root.notification = "";
root.clearPassword(); root.clearPassword();
} }
} }
onMessage: { function onMessage() {
root.notification = msg; root.notification = msg;
} }
onError: { function onError() {
root.notification = err; root.notification = err;
} }
} }
@ -63,7 +63,7 @@ PlasmaCore.ColorScope {
Connections { Connections {
target: sessionManagement target: sessionManagement
onAboutToSuspend: { function onAboutToSuspend() {
root.clearPassword(); root.clearPassword();
} }
} }

@ -87,7 +87,7 @@ SessionManagementScreen {
Connections { Connections {
target: root target: root
onClearPassword: { function onClearPassword() {
passwordBox.forceActiveFocus() passwordBox.forceActiveFocus()
passwordBox.text = ""; passwordBox.text = "";
} }

@ -119,7 +119,6 @@ PlasmaCore.ColorScope {
UserDelegate { UserDelegate {
width: units.gridUnit * 7 width: units.gridUnit * 7
height: width height: width
nameFontSize: theme.defaultFont.pointSize + 2
anchors { anchors {
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter
bottom: parent.verticalCenter bottom: parent.verticalCenter

@ -12,7 +12,6 @@ PlasmaComponents.ToolButton {
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Keyboard Layout: %1", instantiator.objectAt(currentIndex).shortName) text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Keyboard Layout: %1", instantiator.objectAt(currentIndex).shortName)
implicitWidth: minimumWidth implicitWidth: minimumWidth
font.pointSize: config.fontSize
visible: menu.items.length > 1 visible: menu.items.length > 1

@ -19,7 +19,7 @@ SessionManagementScreen {
property int visibleBoundary: mapFromItem(loginButton, 0, 0).y property int visibleBoundary: mapFromItem(loginButton, 0, 0).y
onHeightChanged: visibleBoundary = mapFromItem(loginButton, 0, 0).y + loginButton.height + units.smallSpacing onHeightChanged: visibleBoundary = mapFromItem(loginButton, 0, 0).y + loginButton.height + units.smallSpacing
property int fontSize: config.fontSize property int fontSize: parseInt(config.fontSize)
signal loginRequest(string username, string password) signal loginRequest(string username, string password)

@ -29,6 +29,11 @@ import org.kde.plasma.extras 2.0 as PlasmaExtras
import "components" import "components"
// TODO: Once SDDM 0.19 is released and we are setting the font size using the
// SDDM KCM's syncing feature, remove the `config.fontSize` overrides here and
// the fontSize properties in various components, because the theme's default
// font size will be correctly propagated to the login screen
PlasmaCore.ColorScope { PlasmaCore.ColorScope {
id: root id: root
@ -203,6 +208,7 @@ PlasmaCore.ColorScope {
ActionButton { ActionButton {
iconSource: "system-suspend" iconSource: "system-suspend"
text: i18ndc("plasma_lookandfeel_org.kde.lookandfeel","Suspend to RAM","Sleep") text: i18ndc("plasma_lookandfeel_org.kde.lookandfeel","Suspend to RAM","Sleep")
fontSize: parseInt(config.fontSize) + 1
onClicked: sddm.suspend() onClicked: sddm.suspend()
enabled: sddm.canSuspend enabled: sddm.canSuspend
visible: !inputPanel.keyboardActive visible: !inputPanel.keyboardActive
@ -210,6 +216,7 @@ PlasmaCore.ColorScope {
ActionButton { ActionButton {
iconSource: "system-reboot" iconSource: "system-reboot"
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Restart") text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Restart")
fontSize: parseInt(config.fontSize) + 1
onClicked: sddm.reboot() onClicked: sddm.reboot()
enabled: sddm.canReboot enabled: sddm.canReboot
visible: !inputPanel.keyboardActive visible: !inputPanel.keyboardActive
@ -217,6 +224,7 @@ PlasmaCore.ColorScope {
ActionButton { ActionButton {
iconSource: "system-shutdown" iconSource: "system-shutdown"
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Shut Down") text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Shut Down")
fontSize: parseInt(config.fontSize) + 1
onClicked: sddm.powerOff() onClicked: sddm.powerOff()
enabled: sddm.canPowerOff enabled: sddm.canPowerOff
visible: !inputPanel.keyboardActive visible: !inputPanel.keyboardActive
@ -224,6 +232,7 @@ PlasmaCore.ColorScope {
ActionButton { ActionButton {
iconSource: "system-user-prompt" iconSource: "system-user-prompt"
text: i18ndc("plasma_lookandfeel_org.kde.lookandfeel", "For switching to a username and password prompt", "Other...") text: i18ndc("plasma_lookandfeel_org.kde.lookandfeel", "For switching to a username and password prompt", "Other...")
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 && !inputPanel.keyboardActive
@ -361,6 +370,7 @@ PlasmaCore.ColorScope {
showUsernamePrompt: true showUsernamePrompt: true
notificationMessage: root.notificationMessage notificationMessage: root.notificationMessage
loginScreenUiVisible: loginScreenRoot.uiVisible loginScreenUiVisible: loginScreenRoot.uiVisible
fontSize: parseInt(config.fontSize) + 2
// using a model rather than a QObject list to avoid QTBUG-75900 // using a model rather than a QObject list to avoid QTBUG-75900
userListModel: ListModel { userListModel: ListModel {
@ -383,6 +393,7 @@ PlasmaCore.ColorScope {
ActionButton { ActionButton {
iconSource: "system-suspend" iconSource: "system-suspend"
text: i18ndc("plasma_lookandfeel_org.kde.lookandfeel","Suspend to RAM","Sleep") text: i18ndc("plasma_lookandfeel_org.kde.lookandfeel","Suspend to RAM","Sleep")
fontSize: parseInt(config.fontSize) + 1
onClicked: sddm.suspend() onClicked: sddm.suspend()
enabled: sddm.canSuspend enabled: sddm.canSuspend
visible: !inputPanel.keyboardActive visible: !inputPanel.keyboardActive
@ -390,6 +401,7 @@ PlasmaCore.ColorScope {
ActionButton { ActionButton {
iconSource: "system-reboot" iconSource: "system-reboot"
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Restart") text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Restart")
fontSize: parseInt(config.fontSize) + 1
onClicked: sddm.reboot() onClicked: sddm.reboot()
enabled: sddm.canReboot enabled: sddm.canReboot
visible: !inputPanel.keyboardActive visible: !inputPanel.keyboardActive
@ -397,6 +409,7 @@ PlasmaCore.ColorScope {
ActionButton { ActionButton {
iconSource: "system-shutdown" iconSource: "system-shutdown"
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Shut Down") text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Shut Down")
fontSize: parseInt(config.fontSize) + 1
onClicked: sddm.powerOff() onClicked: sddm.powerOff()
enabled: sddm.canPowerOff enabled: sddm.canPowerOff
visible: !inputPanel.keyboardActive visible: !inputPanel.keyboardActive
@ -404,6 +417,7 @@ PlasmaCore.ColorScope {
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
onClicked: mainStack.pop() onClicked: mainStack.pop()
visible: !inputPanel.keyboardActive visible: !inputPanel.keyboardActive
} }
@ -460,7 +474,7 @@ PlasmaCore.ColorScope {
bottom: parent.bottom bottom: parent.bottom
left: parent.left left: parent.left
right: parent.right right: parent.right
margins: units.smallSpacing margins: PlasmaCore.Units.smallSpacing
} }
Behavior on opacity { Behavior on opacity {
@ -478,17 +492,21 @@ PlasmaCore.ColorScope {
} }
KeyboardButton { KeyboardButton {
font.pointSize: config.fontSize
} }
SessionButton { SessionButton {
id: sessionButton id: sessionButton
font.pointSize: config.fontSize
} }
Item { Item {
Layout.fillWidth: true Layout.fillWidth: true
} }
Battery { } Battery {
fontSize: config.fontSize
}
} }
} }

@ -34,8 +34,6 @@ PlasmaComponents.ToolButton {
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Desktop Session: %1", instantiator.objectAt(currentIndex).text || "") text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Desktop Session: %1", instantiator.objectAt(currentIndex).text || "")
font.pointSize: config.fontSize
Component.onCompleted: { Component.onCompleted: {
currentIndex = sessionModel.lastIndex currentIndex = sessionModel.lastIndex
} }

Loading…
Cancel
Save