Files
qbz/crates/qbz-slint/ui/primitives/LoadingDots.slint
T
vicrodh b874661bbf feat(slint): search loading fade + 1s idle-close on header menus
New LoadingDots primitive (three pulsing dots over an optional label)
shown while a search is running. The result sections fade in once the
results arrive instead of showing empty placeholder colors. The
LoadingDots component is reusable for other heavy loads (large grids,
playlist manager) when they get the same treatment.

The header nav-tab menu now closes after 1s of pointer idle (was 1.5s)
per the project rule that no menu stays open more than 1s idle.
PopupWindow context menus already close on click-outside, which is the
idle behaviour for click-triggered popups.

cc
2026-05-19 20:13:14 -06:00

39 lines
1.1 KiB
Plaintext

// Loading indicator — three pulsing dots above an optional label. A
// lightweight replacement for empty-color placeholders during heavy
// loads (search, large grids, the playlist manager, etc.).
import { Theme } from "../foundation/semantic-colors.slint";
component Dot inherits Rectangle {
in property <float> delay; // 0..1 phase offset
width: 8px;
height: 8px;
border-radius: 4px;
background: Theme.text-secondary;
property <float> phase: Math.mod((animation-tick() / 1ms) / 900.0 + root.delay, 1.0);
property <float> tri: 1.0 - Math.abs(root.phase - 0.5) * 2.0;
opacity: 0.25 + 0.55 * tri;
}
export component LoadingDots inherits Rectangle {
in property <string> label;
VerticalLayout {
alignment: center;
spacing: 12px;
HorizontalLayout {
alignment: center;
spacing: 8px;
Dot { delay: 0.0; }
Dot { delay: 0.18; }
Dot { delay: 0.36; }
}
if root.label != "": Text {
text: root.label;
color: Theme.text-muted;
font-size: 13px;
horizontal-alignment: center;
}
}
}