File: set-default-hints-when-repr-doesn-t-export-Layout.patch

package info (click to toggle)
plasma-framework 5.28.0-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 11,168 kB
  • ctags: 3,945
  • sloc: cpp: 28,840; sh: 534; python: 477; ruby: 117; xml: 110; php: 27; makefile: 5
file content (38 lines) | stat: -rw-r--r-- 1,480 bytes parent folder | download
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;
     }