diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-08-13 15:00:22 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-08-13 15:00:22 +1000 |
| commit | ec9d0359d5ce034a9674f1ab5305c4bec1cc4b2a (patch) | |
| tree | 5b08640ad7fc3d214b831497ae5164829f6d1d7f /modules/lock | |
| parent | bar: per-monitor workspaces option (#394) (diff) | |
| download | caelestia-shell-ec9d0359d5ce034a9674f1ab5305c4bec1cc4b2a.tar.gz caelestia-shell-ec9d0359d5ce034a9674f1ab5305c4bec1cc4b2a.tar.bz2 caelestia-shell-ec9d0359d5ce034a9674f1ab5305c4bec1cc4b2a.zip | |
lock/fetch: hide user when bat and smol
Diffstat (limited to 'modules/lock')
| -rw-r--r-- | modules/lock/Fetch.qml | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/modules/lock/Fetch.qml b/modules/lock/Fetch.qml index eed8987..5584fbd 100644 --- a/modules/lock/Fetch.qml +++ b/modules/lock/Fetch.qml @@ -48,7 +48,7 @@ ColumnLayout { elide: Text.ElideRight } - Loader { + WrappedLoader { Layout.fillHeight: true asynchronous: true active: !iconLoader.active @@ -66,14 +66,11 @@ ColumnLayout { Layout.fillHeight: false spacing: height * 0.15 - Loader { + WrappedLoader { id: iconLoader Layout.fillHeight: true - - asynchronous: true active: root.width > 320 - visible: active sourceComponent: IconImage { source: Quickshell.iconPath(SysInfo.logo) @@ -88,43 +85,42 @@ ColumnLayout { Layout.leftMargin: iconLoader.active ? 0 : width * 0.1 spacing: Appearance.spacing.normal - Loader { + WrappedLoader { Layout.fillWidth: true - asynchronous: true active: !batLoader.active && root.height > 200 - visible: active sourceComponent: FetchText { text: `OS : ${SysInfo.osPrettyName || SysInfo.osName}` } } - Loader { + WrappedLoader { Layout.fillWidth: true - asynchronous: true active: root.height > (batLoader.active ? 200 : 110) - visible: active sourceComponent: FetchText { text: `WM : ${SysInfo.wm}` } } - FetchText { - text: `USER: ${SysInfo.user}` + WrappedLoader { + Layout.fillWidth: true + active: !batLoader.active || root.height > 110 + + sourceComponent: FetchText { + text: `USER: ${SysInfo.user}` + } } FetchText { text: `UP : ${SysInfo.uptime}` } - Loader { + WrappedLoader { id: batLoader Layout.fillWidth: true - asynchronous: true active: UPower.displayDevice.isLaptopBattery - visible: active sourceComponent: FetchText { text: `BATT: ${UPower.onBattery ? "" : "(+) "}${Math.round(UPower.displayDevice.percentage * 100)}%` @@ -133,12 +129,9 @@ ColumnLayout { } } - Loader { + WrappedLoader { Layout.alignment: Qt.AlignHCenter - - asynchronous: true active: root.height > 180 - visible: active sourceComponent: RowLayout { spacing: Appearance.spacing.large @@ -158,6 +151,11 @@ ColumnLayout { } } + component WrappedLoader: Loader { + asynchronous: true + visible: active + } + component FetchText: MonoText { Layout.fillWidth: true font.pointSize: root.width > 400 ? Appearance.font.size.larger : Appearance.font.size.normal |