[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [itinerary] src/app: Apply logo size constraints
From:       Volker Krause <null () kde ! org>
Date:       2018-09-16 10:08:56
Message-ID: E1g1Tz6-0005Nj-CQ () code ! kde ! org
[Download RAW message or body]

Git commit 375acc9c2ff23eb63c1f76268070a1bec42b36a8 by Volker Krause.
Committed on 16/09/2018 at 09:38.
Pushed by vkrause into branch 'master'.

Apply logo size constraints

M  +7    -1    src/app/BoardingPass.qml
M  +8    -1    src/app/EventTicket.qml

https://commits.kde.org/itinerary/375acc9c2ff23eb63c1f76268070a1bec42b36a8

diff --git a/src/app/BoardingPass.qml b/src/app/BoardingPass.qml
index 82bbc3d..b5d9ffd 100644
--- a/src/app/BoardingPass.qml
+++ b/src/app/BoardingPass.qml
@@ -25,13 +25,15 @@ import org.kde.prison 1.0 as Prison
 Item {
     property var pass: null
     property string passId
-    implicitHeight: frontLayout.implicitHeight
+    //implicitHeight: frontLayout.implicitHeight
     implicitWidth: Math.max(frontLayout.implicitWidth, 332)
 
     ColumnLayout {
         id: frontLayout
         spacing: 0
         anchors.fill: parent
+        // HACK to break binding loop on implicitHeight
+        onImplicitHeightChanged: root.implicitHeight = implicitHeight
 
         Rectangle {
             id: headerBackground
@@ -50,6 +52,10 @@ Item {
 
                 Image {
                     Layout.rowSpan: 2
+                    Layout.maximumHeight: 60
+                    Layout.maximumWidth: 150
+                    Layout.preferredWidth: paintedWidth
+                    fillMode: Image.PreserveAspectFit
                     source: passId !== "" ? "image://org.kde.pkpass/" + passId + "/logo" : ""
                     sourceSize.height: 1 // ??? seems necessary to trigger high dpi scaling...
                 }
diff --git a/src/app/EventTicket.qml b/src/app/EventTicket.qml
index dba7f6f..902b0fb 100644
--- a/src/app/EventTicket.qml
+++ b/src/app/EventTicket.qml
@@ -24,9 +24,10 @@ import org.kde.pkpass 1.0 as KPkPass
 import org.kde.prison 1.0 as Prison
 
 Item {
+    id: root
     property var pass: null
     property string passId
-    implicitHeight: frontLayout.implicitHeight
+    //implicitHeight: frontLayout.implicitHeight
     implicitWidth: Math.max(frontLayout.implicitWidth, 332)
 
     ColumnLayout {
@@ -34,6 +35,8 @@ Item {
         spacing: 0
         anchors.fill: parent
         visible: false
+        // HACK to break binding loop on implicitHeight
+        onImplicitHeightChanged: root.implicitHeight = implicitHeight
 
         Rectangle {
             id: bodyBackground
@@ -57,6 +60,10 @@ Item {
 
                     Image {
                         Layout.rowSpan: 2
+                        Layout.maximumHeight: 60
+                        Layout.maximumWidth: 150
+                        Layout.preferredWidth: paintedWidth
+                        fillMode: Image.PreserveAspectFit
                         source: passId !== "" ? "image://org.kde.pkpass/" + passId + "/logo" : ""
                         sourceSize.height: 1 // ??? seems necessary to trigger high dpi scaling...
                     }

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic