1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
From: Marco Martin <notmart@gmail.com>
Date: Fri, 3 Mar 2017 17:52:41 +0100
Subject: set default hints when repr doesn't export Layout.*
when we go from full to compact repr, if the compact
doesn't export a Layout attached property, the hints shouldn't
remain those of the full repr, so reset to default values
BUG:377153
Reviewed-by:Eike Hein
---
src/plasmaquick/appletquickitem.cpp | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/plasmaquick/appletquickitem.cpp b/src/plasmaquick/appletquickitem.cpp
index e2fd40ece..30a6f321d 100644
--- a/src/plasmaquick/appletquickitem.cpp
+++ b/src/plasmaquick/appletquickitem.cpp
@@ -92,7 +92,19 @@ void AppletQuickItemPrivate::connectLayoutAttached(QObject *item)
}
}
+ //if the compact repr doesn't export a Layout.* attached property,
+ //reset our own with default values
if (!layout) {
+ if (ownLayout) {
+ ownLayout->setProperty("minimumWidth", 0);
+ ownLayout->setProperty("minimumHeight", 0);
+ ownLayout->setProperty("preferredWidth", -1);
+ ownLayout->setProperty("preferredHeight", -1);
+ ownLayout->setProperty("maximumWidth", std::numeric_limits<qreal>::infinity());
+ ownLayout->setProperty("maximumHeight", std::numeric_limits<qreal>::infinity());
+ ownLayout->setProperty("fillWidth", false);
+ ownLayout->setProperty("fillHeight", false);
+ }
return;
}
|