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

List:       kde-commits
Subject:    [kirigami] src/controls/templates: try harder to fill the width
From:       Marco Martin <notmart () gmail ! com>
Date:       2016-07-11 18:02:59
Message-ID: E1bMfXn-0002IM-S6 () code ! kde ! org
[Download RAW message or body]

Git commit 13aed68201c43cb9374f5554470720fafe50525d by Marco Martin.
Committed on 11/07/2016 at 18:01.
Pushed by mart into branch 'master'.

try harder to fill the width

in the case it's directly in a ListView, use width:parent.width
in the case is in a ColumnLayout, use Layout.fillWidth: true

removes warnings

M  +3    -1    src/controls/templates/AbstractListItem.qml

http://commits.kde.org/kirigami/13aed68201c43cb9374f5554470720fafe50525d

diff --git a/src/controls/templates/AbstractListItem.qml b/src/controls/templates/AbstractListItem.qml
index cef0f54..ec8a080 100644
--- a/src/controls/templates/AbstractListItem.qml
+++ b/src/controls/templates/AbstractListItem.qml
@@ -18,6 +18,7 @@
  */
 
 import QtQuick 2.1
+import QtQuick.Layouts 1.0
 import QtQuick.Controls 1.0 as Controls
 import QtQuick.Controls.Private 1.0
 import org.kde.kirigami 1.0
@@ -115,11 +116,12 @@ Rectangle {
      */
     property Item background
 
-    implicitWidth: childrenRect.width
+    implicitWidth: contentItem ? contentItem.childrenRect.width : 0
 
     implicitHeight: contentItem.height + Units.smallSpacing*4
 
     width: parent ? parent.width : implicitWidth
+    Layout.fillWidth: true
 
     opacity: enabled ? 1 : 0.6
 
[prev in list] [next in list] [prev in thread] [next in thread] 

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