From ec9d0359d5ce034a9674f1ab5305c4bec1cc4b2a Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Wed, 13 Aug 2025 15:00:22 +1000 Subject: lock/fetch: hide user when bat and smol --- modules/lock/Fetch.qml | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) (limited to 'modules/lock') 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 -- cgit v1.2.3-freya