Better busy indicator defaults

This commit is contained in:
quadbyte 2025-08-11 15:06:54 -04:00
parent 8cc3c47f09
commit ab7bb4a6d4
3 changed files with 27 additions and 10 deletions

View file

@ -172,7 +172,7 @@ NLoader {
running: network.connectingSsid === modelData.ssid running: network.connectingSsid === modelData.ssid
color: Colors.accentPrimary color: Colors.accentPrimary
anchors.centerIn: parent anchors.centerIn: parent
size: 22 * scaling size: Style.baseWidgetSize * 0.7 * scaling
} }
// TBC: Does nothing on my setup // TBC: Does nothing on my setup

View file

@ -24,8 +24,8 @@ NLoader {
radius: Style.radiusMedium * scaling radius: Style.radiusMedium * scaling
border.color: Colors.backgroundTertiary border.color: Colors.backgroundTertiary
border.width: Math.max(1, Style.borderMedium * scaling) border.width: Math.max(1, Style.borderMedium * scaling)
width: 500 * scaling width: 600 * scaling
height: 400 * scaling height: 600 * scaling
anchors.centerIn: parent anchors.centerIn: parent
// Prevent closing when clicking in the panel bg // Prevent closing when clicking in the panel bg
@ -104,7 +104,7 @@ NLoader {
// NToggle // NToggle
ColumnLayout { ColumnLayout {
spacing: Style.marginLarge * scaling spacing: Style.marginMedium * scaling
NText { NText {
text: "NToggle" text: "NToggle"
color: Colors.accentSecondary color: Colors.accentSecondary
@ -126,7 +126,7 @@ NLoader {
// NComboBox // NComboBox
ColumnLayout { ColumnLayout {
spacing: Style.marginLarge * scaling spacing: Style.marginMedium * scaling
NText { NText {
text: "NComboBox" text: "NComboBox"
color: Colors.accentSecondary color: Colors.accentSecondary
@ -146,6 +146,23 @@ NLoader {
Layout.fillWidth: true Layout.fillWidth: true
} }
} }
// NBusyIndicator
ColumnLayout {
spacing: Style.marginMedium * scaling
NText {
text: "NBusyIndicator"
color: Colors.accentSecondary
font.weight: Style.fontWeightBold
}
NBusyIndicator {
}
NDivider {
Layout.fillWidth: true
}
}
} }
} }
} }

View file

@ -6,10 +6,10 @@ Item {
readonly property real scaling: Scaling.scale(screen) readonly property real scaling: Scaling.scale(screen)
property bool running: false property bool running: true
property color color: "white" property color color: Colors.accentPrimary
property int size: baseWidgetSize * 0.5 * scaling property int size: Style.baseWidgetSize * scaling
property int strokeWidth: 2 * scaling property int strokeWidth: Style.borderThick * scaling
property int duration: 1000 property int duration: 1000
implicitWidth: size implicitWidth: size
@ -28,7 +28,7 @@ Item {
var radius = Math.min(width, height) / 2 - strokeWidth / 2 var radius = Math.min(width, height) / 2 - strokeWidth / 2
ctx.strokeStyle = root.color ctx.strokeStyle = root.color
ctx.lineWidth = root.strokeWidth ctx.lineWidth = Math.max(1, root.strokeWidth)
ctx.lineCap = "round" ctx.lineCap = "round"
// Draw arc with gap (270 degrees with 90 degree gap) // Draw arc with gap (270 degrees with 90 degree gap)