diff options
Diffstat (limited to 'modules/bar')
| -rw-r--r-- | modules/bar/components/Settings.qml | 3 | ||||
| -rw-r--r-- | modules/bar/components/SettingsIcon.qml | 3 | ||||
| -rw-r--r-- | modules/bar/components/StatusIcons.qml | 2 | ||||
| -rw-r--r-- | modules/bar/components/workspaces/OccupiedBg.qml | 3 | ||||
| -rw-r--r-- | modules/bar/popouts/Content.qml | 5 | ||||
| -rw-r--r-- | modules/bar/popouts/WirelessPassword.qml | 1 | ||||
| -rw-r--r-- | modules/bar/popouts/Wrapper.qml | 4 | ||||
| -rw-r--r-- | modules/bar/popouts/kblayout/KbLayout.qml | 75 | ||||
| -rw-r--r-- | modules/bar/popouts/kblayout/KbLayoutModel.qml | 60 |
9 files changed, 109 insertions, 47 deletions
diff --git a/modules/bar/components/Settings.qml b/modules/bar/components/Settings.qml index 7cd18be..5d562ce 100644 --- a/modules/bar/components/Settings.qml +++ b/modules/bar/components/Settings.qml @@ -39,6 +39,3 @@ Item { font.pointSize: Appearance.font.size.normal } } - - - diff --git a/modules/bar/components/SettingsIcon.qml b/modules/bar/components/SettingsIcon.qml index 7cd18be..5d562ce 100644 --- a/modules/bar/components/SettingsIcon.qml +++ b/modules/bar/components/SettingsIcon.qml @@ -39,6 +39,3 @@ Item { font.pointSize: Appearance.font.size.normal } } - - - diff --git a/modules/bar/components/StatusIcons.qml b/modules/bar/components/StatusIcons.qml index 442bd2c..ca7dc2e 100644 --- a/modules/bar/components/StatusIcons.qml +++ b/modules/bar/components/StatusIcons.qml @@ -143,7 +143,7 @@ StyledRect { // Network icon WrappedLoader { name: "network" - active: Config.bar.status.showNetwork && (! Nmcli.activeEthernet || Config.bar.status.showWifi) + active: Config.bar.status.showNetwork && (!Nmcli.activeEthernet || Config.bar.status.showWifi) sourceComponent: MaterialIcon { animate: true diff --git a/modules/bar/components/workspaces/OccupiedBg.qml b/modules/bar/components/workspaces/OccupiedBg.qml index da6fa55..56b215e 100644 --- a/modules/bar/components/workspaces/OccupiedBg.qml +++ b/modules/bar/components/workspaces/OccupiedBg.qml @@ -16,7 +16,8 @@ Item { property list<var> pills: [] onOccupiedChanged: { - if (!occupied) return; + if (!occupied) + return; let count = 0; const start = groupOffset; const end = start + Config.bar.workspaces.shown; diff --git a/modules/bar/popouts/Content.qml b/modules/bar/popouts/Content.qml index c9a7c5d..4076844 100644 --- a/modules/bar/popouts/Content.qml +++ b/modules/bar/popouts/Content.qml @@ -58,7 +58,7 @@ Item { wrapper: root.wrapper network: networkPopout.item?.passwordNetwork ?? null } - + Connections { target: root.wrapper function onCurrentNameChanged() { @@ -79,7 +79,7 @@ Item { } } } - + Connections { target: networkPopout function onItemChanged() { @@ -121,7 +121,6 @@ Item { } } - Popout { name: "lockstatus" sourceComponent: LockStatus {} diff --git a/modules/bar/popouts/WirelessPassword.qml b/modules/bar/popouts/WirelessPassword.qml index 5da50b6..96639e7 100644 --- a/modules/bar/popouts/WirelessPassword.qml +++ b/modules/bar/popouts/WirelessPassword.qml @@ -603,4 +603,3 @@ ColumnLayout { } } } - diff --git a/modules/bar/popouts/Wrapper.qml b/modules/bar/popouts/Wrapper.qml index fc74222..05a1d3c 100644 --- a/modules/bar/popouts/Wrapper.qml +++ b/modules/bar/popouts/Wrapper.qml @@ -67,7 +67,7 @@ Item { } close(); } - + Keys.onPressed: event => { // Don't intercept keys when password popout is active - let it handle them if (currentName === "wirelesspassword") { @@ -88,7 +88,7 @@ Item { property: "WlrLayershell.keyboardFocus" value: WlrKeyboardFocus.OnDemand } - + Binding { when: root.hasCurrent && root.currentName === "wirelesspassword" diff --git a/modules/bar/popouts/kblayout/KbLayout.qml b/modules/bar/popouts/kblayout/KbLayout.qml index f612f58..94b6f7e 100644 --- a/modules/bar/popouts/kblayout/KbLayout.qml +++ b/modules/bar/popouts/kblayout/KbLayout.qml @@ -19,9 +19,13 @@ ColumnLayout { spacing: Appearance.spacing.small width: Config.bar.sizes.kbLayoutWidth - KbLayoutModel { id: kb } + KbLayoutModel { + id: kb + } - function refresh() { kb.refresh() } + function refresh() { + kb.refresh(); + } Component.onCompleted: kb.start() StyledText { @@ -46,12 +50,39 @@ ColumnLayout { spacing: Appearance.spacing.small add: Transition { - NumberAnimation { properties: "opacity"; from: 0; to: 1; duration: 140 } - NumberAnimation { properties: "y"; duration: 180; easing.type: Easing.OutCubic } + NumberAnimation { + properties: "opacity" + from: 0 + to: 1 + duration: 140 + } + NumberAnimation { + properties: "y" + duration: 180 + easing.type: Easing.OutCubic + } + } + remove: Transition { + NumberAnimation { + properties: "opacity" + to: 0 + duration: 100 + } + } + move: Transition { + NumberAnimation { + properties: "y" + duration: 180 + easing.type: Easing.OutCubic + } + } + displaced: Transition { + NumberAnimation { + properties: "y" + duration: 180 + easing.type: Easing.OutCubic + } } - remove: Transition { NumberAnimation { properties: "opacity"; to: 0; duration: 100 } } - move: Transition { NumberAnimation { properties: "y"; duration: 180; easing.type: Easing.OutCubic } } - displaced: Transition { NumberAnimation { properties: "y"; duration: 180; easing.type: Easing.OutCubic } } delegate: Item { required property int layoutIndex @@ -145,13 +176,35 @@ ColumnLayout { running: false ParallelAnimation { - NumberAnimation { target: activeRow; property: "opacity"; to: 0.0; duration: 70 } - NumberAnimation { target: activeRow; property: "scale"; to: 0.92; duration: 70 } + NumberAnimation { + target: activeRow + property: "opacity" + to: 0.0 + duration: 70 + } + NumberAnimation { + target: activeRow + property: "scale" + to: 0.92 + duration: 70 + } } ParallelAnimation { - NumberAnimation { target: activeRow; property: "opacity"; to: 1.0; duration: 160; easing.type: Easing.OutCubic } - NumberAnimation { target: activeRow; property: "scale"; to: 1.0; duration: 220; easing.type: Easing.OutBack } + NumberAnimation { + target: activeRow + property: "opacity" + to: 1.0 + duration: 160 + easing.type: Easing.OutCubic + } + NumberAnimation { + target: activeRow + property: "scale" + to: 1.0 + duration: 220 + easing.type: Easing.OutBack + } } } } diff --git a/modules/bar/popouts/kblayout/KbLayoutModel.qml b/modules/bar/popouts/kblayout/KbLayoutModel.qml index 41e45b3..4371095 100644 --- a/modules/bar/popouts/kblayout/KbLayoutModel.qml +++ b/modules/bar/popouts/kblayout/KbLayoutModel.qml @@ -12,7 +12,9 @@ Item { id: model visible: false - ListModel { id: _visibleModel } + ListModel { + id: _visibleModel + } property alias visibleModel: _visibleModel property string activeLabel: "" @@ -33,7 +35,9 @@ Item { _switchProc.running = true; } - ListModel { id: _layoutsModel } + ListModel { + id: _layoutsModel + } property var _xkbMap: ({}) property bool _notifiedLimit: false @@ -41,14 +45,19 @@ Item { Process { id: _xkbXmlBase command: ["xmllint", "--xpath", "//layout/configItem[name and description]", "/usr/share/X11/xkb/rules/base.xml"] - stdout: StdioCollector { onStreamFinished: _buildXmlMap(text) } - onRunningChanged: if (!running && (typeof exitCode !== "undefined") && exitCode !== 0) _xkbXmlEvdev.running = true + stdout: StdioCollector { + onStreamFinished: _buildXmlMap(text) + } + onRunningChanged: if (!running && (typeof exitCode !== "undefined") && exitCode !== 0) + _xkbXmlEvdev.running = true } Process { id: _xkbXmlEvdev command: ["xmllint", "--xpath", "//layout/configItem[name and description]", "/usr/share/X11/xkb/rules/evdev.xml"] - stdout: StdioCollector { onStreamFinished: _buildXmlMap(text) } + stdout: StdioCollector { + onStreamFinished: _buildXmlMap(text) + } } function _buildXmlMap(xml) { @@ -60,7 +69,8 @@ Item { while ((m = re.exec(xml)) !== null) { const code = (m[1] || "").trim(); const desc = (m[2] || "").trim(); - if (!code || !desc) continue; + if (!code || !desc) + continue; map[code] = _short(desc); } @@ -73,7 +83,11 @@ Item { const tmp = []; for (let i = 0; i < _layoutsModel.count; i++) { const it = _layoutsModel.get(i); - tmp.push({ layoutIndex: it.layoutIndex, token: it.token, label: _pretty(it.token) }); + tmp.push({ + layoutIndex: it.layoutIndex, + token: it.token, + label: _pretty(it.token) + }); } _layoutsModel.clear(); tmp.forEach(t => _layoutsModel.append(t)); @@ -83,7 +97,8 @@ Item { function _short(desc) { const m = desc.match(/^(.*)\((.*)\)$/); - if (!m) return desc; + if (!m) + return desc; const lang = m[1].trim(); const region = m[2].trim(); const code = (region.split(/[,\s-]/)[0] || region).slice(0, 2).toUpperCase(); @@ -118,7 +133,8 @@ Item { const dev = JSON.parse(text); const kb = dev?.keyboards?.find(k => k.main) || dev?.keyboards?.[0]; const raw = (kb?.layout || "").trim(); - if (raw.length) _setLayouts(raw); + if (raw.length) + _setLayouts(raw); } catch (e) {} _fetchActiveLayouts.running = true; } @@ -136,10 +152,7 @@ Item { const idx = kb?.active_layout_index ?? -1; activeIndex = idx >= 0 ? idx : -1; - activeLabel = - (idx >= 0 && idx < _layoutsModel.count) - ? _layoutsModel.get(idx).label - : ""; + activeLabel = (idx >= 0 && idx < _layoutsModel.count) ? _layoutsModel.get(idx).label : ""; } catch (e) { activeIndex = -1; activeLabel = ""; @@ -152,7 +165,8 @@ Item { Process { id: _switchProc - onRunningChanged: if (!running) _fetchActiveLayouts.running = true + onRunningChanged: if (!running) + _fetchActiveLayouts.running = true } function _setLayouts(raw) { @@ -163,9 +177,14 @@ Item { let idx = 0; for (const p of parts) { - if (seen.has(p)) continue; + if (seen.has(p)) + continue; seen.add(p); - _layoutsModel.append({ layoutIndex: idx, token: p, label: _pretty(p) }); + _layoutsModel.append({ + layoutIndex: idx, + token: p, + label: _pretty(p) + }); idx++; } } @@ -184,17 +203,14 @@ Item { return; if (_layoutsModel.count > 4) { - Toaster.toast( - qsTr("Keyboard layout limit"), - qsTr("XKB supports only 4 layouts at a time"), - "warning" - ); + Toaster.toast(qsTr("Keyboard layout limit"), qsTr("XKB supports only 4 layouts at a time"), "warning"); } } function _pretty(token) { const code = token.replace(/\(.*\)$/, "").trim(); - if (_xkbMap[code]) return code.toUpperCase() + " - " + _xkbMap[code]; + if (_xkbMap[code]) + return code.toUpperCase() + " - " + _xkbMap[code]; return code.toUpperCase() + " - " + code; } } |