From ab7bb4a6d4e1e81d760db941d6e7cd6a21532f08 Mon Sep 17 00:00:00 2001 From: quadbyte Date: Mon, 11 Aug 2025 15:06:54 -0400 Subject: [PATCH] Better busy indicator defaults --- Modules/Bar/WiFiMenu.qml | 2 +- Modules/DemoPanel/DemoPanel.qml | 25 +++++++++++++++++++++---- Widgets/NBusyIndicator.qml | 10 +++++----- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/Modules/Bar/WiFiMenu.qml b/Modules/Bar/WiFiMenu.qml index b0db279..ed5dca6 100644 --- a/Modules/Bar/WiFiMenu.qml +++ b/Modules/Bar/WiFiMenu.qml @@ -172,7 +172,7 @@ NLoader { running: network.connectingSsid === modelData.ssid color: Colors.accentPrimary anchors.centerIn: parent - size: 22 * scaling + size: Style.baseWidgetSize * 0.7 * scaling } // TBC: Does nothing on my setup diff --git a/Modules/DemoPanel/DemoPanel.qml b/Modules/DemoPanel/DemoPanel.qml index f2ca9fd..e06d04d 100644 --- a/Modules/DemoPanel/DemoPanel.qml +++ b/Modules/DemoPanel/DemoPanel.qml @@ -24,8 +24,8 @@ NLoader { radius: Style.radiusMedium * scaling border.color: Colors.backgroundTertiary border.width: Math.max(1, Style.borderMedium * scaling) - width: 500 * scaling - height: 400 * scaling + width: 600 * scaling + height: 600 * scaling anchors.centerIn: parent // Prevent closing when clicking in the panel bg @@ -104,7 +104,7 @@ NLoader { // NToggle ColumnLayout { - spacing: Style.marginLarge * scaling + spacing: Style.marginMedium * scaling NText { text: "NToggle" color: Colors.accentSecondary @@ -126,7 +126,7 @@ NLoader { // NComboBox ColumnLayout { - spacing: Style.marginLarge * scaling + spacing: Style.marginMedium * scaling NText { text: "NComboBox" color: Colors.accentSecondary @@ -146,6 +146,23 @@ NLoader { Layout.fillWidth: true } } + + // NBusyIndicator + ColumnLayout { + spacing: Style.marginMedium * scaling + NText { + text: "NBusyIndicator" + color: Colors.accentSecondary + font.weight: Style.fontWeightBold + } + + NBusyIndicator { + } + + NDivider { + Layout.fillWidth: true + } + } } } } diff --git a/Widgets/NBusyIndicator.qml b/Widgets/NBusyIndicator.qml index 0f963e2..d405449 100644 --- a/Widgets/NBusyIndicator.qml +++ b/Widgets/NBusyIndicator.qml @@ -6,10 +6,10 @@ Item { readonly property real scaling: Scaling.scale(screen) - property bool running: false - property color color: "white" - property int size: baseWidgetSize * 0.5 * scaling - property int strokeWidth: 2 * scaling + property bool running: true + property color color: Colors.accentPrimary + property int size: Style.baseWidgetSize * scaling + property int strokeWidth: Style.borderThick * scaling property int duration: 1000 implicitWidth: size @@ -28,7 +28,7 @@ Item { var radius = Math.min(width, height) / 2 - strokeWidth / 2 ctx.strokeStyle = root.color - ctx.lineWidth = root.strokeWidth + ctx.lineWidth = Math.max(1, root.strokeWidth) ctx.lineCap = "round" // Draw arc with gap (270 degrees with 90 degree gap)