summaryrefslogtreecommitdiff
path: root/modules/bar/popouts
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2026-01-28 19:21:44 +1100
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2026-01-28 19:21:44 +1100
commit9d7f0c48cebec02aaf2ca780b89a763ce91f8624 (patch)
tree2345921b670f730268203020e754465503707ed3 /modules/bar/popouts
parentcontrolcenter: remove qt5compat dep (diff)
downloadcaelestia-shell-9d7f0c48cebec02aaf2ca780b89a763ce91f8624.tar.gz
caelestia-shell-9d7f0c48cebec02aaf2ca780b89a763ce91f8624.tar.bz2
caelestia-shell-9d7f0c48cebec02aaf2ca780b89a763ce91f8624.zip
internal: format
Diffstat (limited to 'modules/bar/popouts')
-rw-r--r--modules/bar/popouts/Content.qml5
-rw-r--r--modules/bar/popouts/WirelessPassword.qml1
-rw-r--r--modules/bar/popouts/Wrapper.qml4
-rw-r--r--modules/bar/popouts/kblayout/KbLayout.qml75
-rw-r--r--modules/bar/popouts/kblayout/KbLayoutModel.qml60
5 files changed, 106 insertions, 39 deletions
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;
}
}