summaryrefslogtreecommitdiff
path: root/x11-themes/redcore-theme-sddm/files/redcore/KeyboardButton.qml
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-07-19 08:30:54 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-07-19 08:30:54 +0100
commit00daf2b567178634466e638a673632d7ed5ef742 (patch)
tree563baaa8a488a714f3b316002489ef3cb858a2d1 /x11-themes/redcore-theme-sddm/files/redcore/KeyboardButton.qml
parent33a4996767dbd6662a67e169841ac3e846eccb42 (diff)
Revert "let's try again : move x11-themes/redcore-theme-sddm -> x11-themes/redcore-artwork-sddm"
This reverts commit 33a4996767dbd6662a67e169841ac3e846eccb42.
Diffstat (limited to 'x11-themes/redcore-theme-sddm/files/redcore/KeyboardButton.qml')
-rw-r--r--x11-themes/redcore-theme-sddm/files/redcore/KeyboardButton.qml38
1 files changed, 38 insertions, 0 deletions
diff --git a/x11-themes/redcore-theme-sddm/files/redcore/KeyboardButton.qml b/x11-themes/redcore-theme-sddm/files/redcore/KeyboardButton.qml
new file mode 100644
index 00000000..9989d93e
--- /dev/null
+++ b/x11-themes/redcore-theme-sddm/files/redcore/KeyboardButton.qml
@@ -0,0 +1,38 @@
+import QtQuick 2.2
+
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.plasma.components 2.0 as PlasmaComponents
+
+import QtQuick.Controls 1.3 as QQC
+
+PlasmaComponents.ToolButton {
+ id: keyboardButton
+
+ property int currentIndex: -1
+
+ text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Keyboard Layout: %1", instantiator.objectAt(currentIndex).shortName)
+ implicitWidth: minimumWidth
+ font.pointSize: config.fontSize
+
+ visible: menu.items.length > 1
+
+ Component.onCompleted: currentIndex = Qt.binding(function() {return keyboard.currentLayout});
+
+ menu: QQC.Menu {
+ id: keyboardMenu
+ style: BreezeMenuStyle {}
+ Instantiator {
+ id: instantiator
+ model: keyboard.layouts
+ onObjectAdded: keyboardMenu.insertItem(index, object)
+ onObjectRemoved: keyboardMenu.removeItem( object )
+ delegate: QQC.MenuItem {
+ text: modelData.longName
+ property string shortName: modelData.shortName
+ onTriggered: {
+ keyboard.currentLayout = model.index
+ }
+ }
+ }
+ }
+}