mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
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:
committed by
Wilfred Mallawa
parent
e4729d9b92
commit
33fe169edc
+15
-8
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user