Show input switching only for multiple layouts or methods
This commit is contained in:
1 parent
59fb2fd304
commit
e8b1a1f874
6 files changed
+19
-8
No files matched your search
@@ -91,6 +91,14 @@ BarWidget {
|
||||
//
|
||||
// Keyboards given their own kb_layout hold a different list and are left out:
|
||||
// an index into this list would not mean the same layout to them.
|
||||
ShellIpc {
|
||||
target: "omarchy.keyboard-layout"
|
||||
|
||||
function cycle(): void {
|
||||
root.cycleLayout()
|
||||
}
|
||||
}
|
||||
|
||||
function cycleLayout() {
|
||||
if (!root.bar || root.layoutCount < 2 || root.syncNames.length === 0) return
|
||||
const next = (root.layoutIndex + 1) % root.layoutCount
|
||||
|
||||
@@ -119,13 +119,12 @@ function inputLabel(state, fallback) {
|
||||
|
||||
function inputTooltip(state, layout, multipleLayouts) {
|
||||
if (!state || !state.methods || state.methods.length < 2)
|
||||
return layout + (multipleLayouts ? "" : "\nClick to set up an input language")
|
||||
return layout + (multipleLayouts ? " · Super + I" : "")
|
||||
return (state.name || layout).replace(/^Keyboard - /, "") + " · Super + I"
|
||||
}
|
||||
|
||||
function showIndicator(layoutLabel, multipleLayouts, multipleInputs) {
|
||||
return multipleInputs || (layoutLabel !== "" &&
|
||||
(multipleLayouts || (layoutLabel !== "EN" && layoutLabel !== "ENG")))
|
||||
return multipleInputs || (layoutLabel !== "" && multipleLayouts)
|
||||
}
|
||||
|
||||
function layoutIndex(keyboard) {
|
||||
|
||||
Reference in new issue
Block a user