diff options
Diffstat (limited to 'modules/lock/Fetch.qml')
| -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 |