mirror of
https://github.com/L4ki/Jolly-Plasma-Themes.git
synced 2026-02-01 21:27:38 +01:00
Add files via upload
This commit is contained in:
38
Jolly SDDM Themes/Jolly-SDDM/KeyboardButton.qml
Normal file
38
Jolly SDDM Themes/Jolly-SDDM/KeyboardButton.qml
Normal file
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user