From 4d0a0a453dbb93ce18b6917d9ff75bc04113f6a8 Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Mon, 10 Oct 2016 22:13:29 +0200 Subject: [PATCH] [SDDM Theme] Show caps lock warning We do the same on the lock screen and the code is straight from there. Differential Revision: https://phabricator.kde.org/D3011 --- sddm-theme/Main.qml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/sddm-theme/Main.qml b/sddm-theme/Main.qml index 5c3cce537..4230cbe46 100644 --- a/sddm-theme/Main.qml +++ b/sddm-theme/Main.qml @@ -40,6 +40,12 @@ PlasmaCore.ColorScope { LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft LayoutMirroring.childrenInherit: true + PlasmaCore.DataSource { + id: keystateSource + engine: "keystate" + connectedSources: "Caps Lock" + } + Repeater { model: screenModel @@ -86,7 +92,17 @@ PlasmaCore.ColorScope { userListCurrentIndex: userModel.lastIndex >= 0 ? userModel.lastIndex : 0 showUserList: (userListModel.count && userListModel.disableAvatarsThreshold) ? userListModel.count <= userListModel.disableAvatarsThreshold : true - notificationMessage: root.notificationMessage + notificationMessage: { + var text = "" + if (keystateSource.data["Caps Lock"]["Locked"]) { + text += i18nd("plasma_lookandfeel_org.kde.lookandfeel","Caps Lock is on") + if (root.notificationMessage) { + text += " • " + } + } + text += root.notificationMessage + return text + } actionItems: [ ActionButton {