Fix spacing of shutter controls

This commit is contained in:
Michael Zanetti 2019-10-28 17:19:56 +01:00
parent 69f2f61df5
commit 77a939a4db
6 changed files with 5 additions and 2 deletions

View File

@ -6,8 +6,6 @@ import Nymea 1.0
RowLayout { RowLayout {
id: root id: root
spacing: (parent.width - app.iconSize*2*children.length) / (children.length - 1)
// implicitWidth: app.iconSize * 2 * children.length + spacing * (children.length - 1)
implicitWidth: childrenRect.width implicitWidth: childrenRect.width
property var device: null property var device: null

View File

@ -123,6 +123,7 @@ DeviceListPageBase {
Item { Item {
Layout.preferredWidth: shutterControls.implicitWidth Layout.preferredWidth: shutterControls.implicitWidth
Layout.preferredHeight: app.iconSize * 2 Layout.preferredHeight: app.iconSize * 2
Rectangle { anchors.fill: parent; color: "green"; opacity: .3 }
ShutterControls { ShutterControls {
id: shutterControls id: shutterControls
height: parent.height height: parent.height

View File

@ -74,6 +74,7 @@ DevicePageBase {
device: root.device device: root.device
invert: true invert: true
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
spacing: (parent.width - app.iconSize*2*children.length) / (children.length - 1)
} }
} }

View File

@ -84,6 +84,7 @@ DevicePageBase {
id: shutterControls id: shutterControls
device: root.device device: root.device
anchors.centerIn: parent anchors.centerIn: parent
spacing: (parent.width - app.iconSize*2*children.length) / (children.length - 1)
ItemDelegate { ItemDelegate {
Layout.preferredWidth: app.iconSize * 2 Layout.preferredWidth: app.iconSize * 2

View File

@ -72,6 +72,7 @@ DevicePageBase {
id: shutterControls id: shutterControls
device: root.device device: root.device
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
spacing: (parent.width - app.iconSize*2*children.length) / (children.length - 1)
} }
} }
} }

View File

@ -82,6 +82,7 @@ Item {
ShutterControls { ShutterControls {
id: controls id: controls
device: garageGateView.device device: garageGateView.device
spacing: (parent.width - app.iconSize*2*children.length) / (children.length - 1)
} }
} }
} }