From 021a49a72d2ab8c55a122925f1aede27a3318dd8 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sat, 30 Aug 2025 22:09:05 +0200 Subject: [PATCH] wifi & bluetooth dialogs: indeterminate progressbar while scanning --- .../widgets/StyledIndeterminateProgressBar.qml | 15 +++++++++++++++ .../bluetoothDevices/BluetoothDialog.qml | 13 +++++++++++-- .../sidebarRight/wifiNetworks/WifiDialog.qml | 16 ++++++++++++---- 3 files changed, 38 insertions(+), 6 deletions(-) create mode 100644 .config/quickshell/ii/modules/common/widgets/StyledIndeterminateProgressBar.qml diff --git a/.config/quickshell/ii/modules/common/widgets/StyledIndeterminateProgressBar.qml b/.config/quickshell/ii/modules/common/widgets/StyledIndeterminateProgressBar.qml new file mode 100644 index 000000000..5dc1ef9cc --- /dev/null +++ b/.config/quickshell/ii/modules/common/widgets/StyledIndeterminateProgressBar.qml @@ -0,0 +1,15 @@ +import qs.services +import qs.modules.common +import qs.modules.common.widgets +import QtQuick +import QtQuick.Controls.Material +import QtQuick.Controls +import QtQuick.Layouts +import Quickshell +import Quickshell.Widgets +import Qt5Compat.GraphicalEffects + +ProgressBar { + indeterminate: true + Material.accent: Appearance.colors.colPrimary +} diff --git a/.config/quickshell/ii/modules/sidebarRight/bluetoothDevices/BluetoothDialog.qml b/.config/quickshell/ii/modules/sidebarRight/bluetoothDevices/BluetoothDialog.qml index 4e5d99921..2650f6d69 100644 --- a/.config/quickshell/ii/modules/sidebarRight/bluetoothDevices/BluetoothDialog.qml +++ b/.config/quickshell/ii/modules/sidebarRight/bluetoothDevices/BluetoothDialog.qml @@ -19,8 +19,17 @@ WindowDialog { WindowDialogTitle { text: Translation.tr("Bluetooth devices") } - // TODO: add indeterminate progress bar when scanning - WindowDialogSeparator {} + WindowDialogSeparator { + visible: !Bluetooth.defaultAdapter.discovering + } + StyledIndeterminateProgressBar { + visible: Bluetooth.defaultAdapter.discovering + Layout.fillWidth: true + Layout.topMargin: -8 + Layout.bottomMargin: -8 + Layout.leftMargin: -Appearance.rounding.large + Layout.rightMargin: -Appearance.rounding.large + } StyledListView { Layout.fillHeight: true Layout.fillWidth: true diff --git a/.config/quickshell/ii/modules/sidebarRight/wifiNetworks/WifiDialog.qml b/.config/quickshell/ii/modules/sidebarRight/wifiNetworks/WifiDialog.qml index abd854cfc..cb7686c44 100644 --- a/.config/quickshell/ii/modules/sidebarRight/wifiNetworks/WifiDialog.qml +++ b/.config/quickshell/ii/modules/sidebarRight/wifiNetworks/WifiDialog.qml @@ -13,9 +13,18 @@ WindowDialog { WindowDialogTitle { text: Translation.tr("Connect to Wi-Fi") } - // TODO: add indeterminate progress bar when scanning - WindowDialogSeparator {} - StyledListView { + WindowDialogSeparator { + visible: !Network.wifiScanning + } + StyledIndeterminateProgressBar { + visible: Network.wifiScanning + Layout.fillWidth: true + Layout.topMargin: -8 + Layout.bottomMargin: -8 + Layout.leftMargin: -Appearance.rounding.large + Layout.rightMargin: -Appearance.rounding.large + } + ListView { Layout.fillHeight: true Layout.fillWidth: true Layout.topMargin: -15 @@ -25,7 +34,6 @@ WindowDialog { clip: true spacing: 0 - animateAppearance: false model: ScriptModel { values: [...Network.wifiNetworks].sort((a, b) => {