OSD: another attempt at blind fixing #1425

This commit is contained in:
Lemmy
2026-01-23 08:06:39 -05:00
parent ef0ef12933
commit 6a8ecfb321
+18 -2
View File
@@ -456,6 +456,7 @@ Variants {
visible: false
opacity: 0
scale: 0.85
property bool pendingShow: false
Behavior on opacity {
NumberAnimation {
@@ -511,9 +512,15 @@ Variants {
id: contentLoader
anchors.fill: background
anchors.margins: Style.marginM
// Delay activation until background has valid dimensions to avoid negative layout sizes
active: background.width > 0 && background.height > 0
active: true
sourceComponent: panel.verticalMode ? verticalContent : horizontalContent
onWidthChanged: {
if (width > 0 && height > 0 && osdItem.pendingShow) {
osdItem.pendingShow = false;
osdItem.show();
}
}
}
Component {
@@ -743,6 +750,14 @@ Variants {
function show() {
hideTimer.stop();
visibilityTimer.stop();
// Defer show until content layout has valid geometry
if (contentLoader.width <= 0 || contentLoader.height <= 0) {
pendingShow = true;
return;
}
pendingShow = false;
osdItem.visible = true;
Qt.callLater(() => {
@@ -764,6 +779,7 @@ Variants {
function hideImmediately() {
hideTimer.stop();
visibilityTimer.stop();
pendingShow = false;
osdItem.opacity = 0;
osdItem.scale = 0.85;
osdItem.visible = false;