diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-04-25 13:00:07 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-04-25 13:00:07 +0200 |
commit | d6d306186395fa45a52a3fbd124af8a67e8e6f8b (patch) | |
tree | 3d5e97532bb325981552c988e442b5898490b058 /components | |
parent | 1b83395bd53945eaab277138c02bcab3e63f41c5 (diff) | |
download | kube-d6d306186395fa45a52a3fbd124af8a67e8e6f8b.tar.gz kube-d6d306186395fa45a52a3fbd124af8a67e8e6f8b.zip |
Fixed resizing issues
Properly anchor all components and then let the layout deal with it.
Setting a maximum size for splits that depends on the application window
breaks initial layouting, probably because the window size initially is
0 and that results in the default size not being applied.
Since I don't think the maximum size is overly useful we can live
without for the time being.
Diffstat (limited to 'components')
-rw-r--r-- | components/kube/contents/ui/Kube.qml | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/components/kube/contents/ui/Kube.qml b/components/kube/contents/ui/Kube.qml index b3bee859..d2d2fad2 100644 --- a/components/kube/contents/ui/Kube.qml +++ b/components/kube/contents/ui/Kube.qml | |||
@@ -20,6 +20,7 @@ | |||
20 | import QtQuick 2.7 | 20 | import QtQuick 2.7 |
21 | import QtQuick.Controls 1.3 | 21 | import QtQuick.Controls 1.3 |
22 | import QtQuick.Layouts 1.1 | 22 | import QtQuick.Layouts 1.1 |
23 | import QtQuick.Window 2.0 | ||
23 | 24 | ||
24 | import QtQuick.Controls 2.0 as Controls2 | 25 | import QtQuick.Controls 2.0 as Controls2 |
25 | 26 | ||
@@ -29,11 +30,8 @@ import org.kube.components.accounts 1.0 as KubeAccounts | |||
29 | Controls2.ApplicationWindow { | 30 | Controls2.ApplicationWindow { |
30 | id: app | 31 | id: app |
31 | 32 | ||
32 | //FIXME remove fixed pixel hight | 33 | height: Screen.desktopAvailableHeight * 0.8 |
33 | //for now just convinience during testing | 34 | width: Screen.desktopAvailableWidth * 0.8 |
34 | height: 1080 * 0.8 | ||
35 | width: 1920 * 0.8 | ||
36 | |||
37 | visible: true | 35 | visible: true |
38 | 36 | ||
39 | Kube.Listener { | 37 | Kube.Listener { |
@@ -96,15 +94,18 @@ Controls2.ApplicationWindow { | |||
96 | 94 | ||
97 | //BEGIN Main content | 95 | //BEGIN Main content |
98 | RowLayout { | 96 | RowLayout { |
97 | id: mainContent | ||
99 | spacing: 0 | 98 | spacing: 0 |
100 | 99 | anchors.fill: parent | |
101 | width: parent.width | ||
102 | 100 | ||
103 | Rectangle { | 101 | Rectangle { |
104 | id: sideBar | 102 | id: sideBar |
105 | 103 | ||
104 | anchors { | ||
105 | top: parent.top | ||
106 | bottom: parent.bottom | ||
107 | } | ||
106 | width: Kube.Units.gridUnit + Kube.Units.largeSpacing | 108 | width: Kube.Units.gridUnit + Kube.Units.largeSpacing |
107 | height: app.height | ||
108 | color: "#232629"//Kube.Colors.textColor | 109 | color: "#232629"//Kube.Colors.textColor |
109 | 110 | ||
110 | Column { | 111 | Column { |
@@ -169,12 +170,14 @@ Controls2.ApplicationWindow { | |||
169 | } | 170 | } |
170 | 171 | ||
171 | SplitView { | 172 | SplitView { |
172 | height: app.height | 173 | anchors { |
174 | top: parent.top | ||
175 | bottom: parent.bottom | ||
176 | } | ||
173 | Layout.fillWidth: true | 177 | Layout.fillWidth: true |
174 | 178 | ||
175 | Rectangle { | 179 | Rectangle { |
176 | width: Kube.Units.gridUnit * 10 | 180 | width: Kube.Units.gridUnit * 10 |
177 | Layout.maximumWidth: app.width * 0.25 | ||
178 | Layout.minimumWidth: Kube.Units.gridUnit * 5 | 181 | Layout.minimumWidth: Kube.Units.gridUnit * 5 |
179 | 182 | ||
180 | color: Kube.Colors.textColor | 183 | color: Kube.Colors.textColor |
@@ -206,7 +209,6 @@ Controls2.ApplicationWindow { | |||
206 | left: newMailButton.left | 209 | left: newMailButton.left |
207 | right: parent.right | 210 | right: parent.right |
208 | } | 211 | } |
209 | width: parent.width - Kube.Units.largeSpacing | ||
210 | } | 212 | } |
211 | } | 213 | } |
212 | //TODO bring back status bar | 214 | //TODO bring back status bar |
@@ -242,7 +244,6 @@ Controls2.ApplicationWindow { | |||
242 | id: mailListView | 244 | id: mailListView |
243 | width: Kube.Units.gridUnit * 20 | 245 | width: Kube.Units.gridUnit * 20 |
244 | height: parent.height | 246 | height: parent.height |
245 | Layout.maximumWidth: app.width * 0.4 | ||
246 | Layout.minimumWidth: Kube.Units.gridUnit * 10 | 247 | Layout.minimumWidth: Kube.Units.gridUnit * 10 |
247 | focus: true | 248 | focus: true |
248 | } | 249 | } |