mirror of
https://github.com/luneko/SweetTokyoNight.git
synced 2025-12-13 15:29:53 +01:00
KDE: Fix KeyboardLayoutButton in lockscreen
This commit is contained in:
@@ -32,21 +32,31 @@ PlasmaComponents.ToolButton {
|
||||
|
||||
iconName: "input-keyboard"
|
||||
implicitWidth: minimumWidth
|
||||
text: layout.currentLayoutDisplayName
|
||||
text: layout.layoutName()
|
||||
font.pointSize: Math.max(fontSize,theme.defaultFont.pointSize)
|
||||
|
||||
Accessible.name: i18ndc("plasma_lookandfeel_org.kde.lookandfeel", "Button to change keyboard layout", "Switch layout")
|
||||
|
||||
visible: layout.layouts.length > 1
|
||||
visible: layout.shouldBeVisible()
|
||||
|
||||
onClicked: layout.nextLayout()
|
||||
|
||||
KeyboardLayout {
|
||||
id: layout
|
||||
function nextLayout() {
|
||||
var layouts = layout.layouts;
|
||||
var index = (layouts.indexOf(layout.currentLayout)+1) % layouts.length;
|
||||
layout.currentLayout = layouts[index];
|
||||
function nextLayout() {
|
||||
layout.layout = (layout.layout + 1) % layout.layoutsList.length;
|
||||
}
|
||||
|
||||
function shouldBeVisible() {
|
||||
return layout.layoutsList.length > 1;
|
||||
}
|
||||
|
||||
function layoutName() {
|
||||
return (layout.isInitialized() && layout.layoutsList[layout.layout].displayName) || '';
|
||||
}
|
||||
|
||||
function isInitialized() {
|
||||
return layout.layoutsList.length > 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user