fix(osd): defer first show to prevent percentage text overflow

On first OSD display, the percentage text would render outside the
bounding box because the layout hadn't finished positioning children.

Add a small delay 30ms delay before rendering the OSD, which seems to be
enough time to allow for things to synchronize.

Signed-off-by: Wilfred Mallawa <wilfred.opensource@gmail.com>
This commit is contained in:
Wilfred Mallawa
2026-01-23 22:40:44 +11:00
committed by Wilfred Mallawa
parent e4729d9b92
commit 33fe169edc
+15 -8
View File
@@ -740,17 +740,24 @@ Variants {
}
}
// Delay showing the OSD to allow the layout to settle after activation.
// Without this, the percentage text renders outside the box on first
// show.
Timer {
id: showDelayTimer
interval: 30
onTriggered: {
osdItem.visible = true;
osdItem.opacity = 1;
osdItem.scale = 1.0;
hideTimer.start();
}
}
function show() {
hideTimer.stop();
visibilityTimer.stop();
osdItem.visible = true;
Qt.callLater(() => {
osdItem.opacity = 1;
osdItem.scale = 1.0;
});
hideTimer.start();
showDelayTimer.start();
}
function hide() {