mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-01 06:30:26 +00:00
QML UI: Don't explicitly set width of GridLayout items
It is not recommended to set the width explicitly of items in a layout. This
caused some issues in DiveDetailsView, which were fixed by commit 1030cb2
.
See http://doc.qt.io/qt-5/qml-qtquick-layouts-layout.html#details
Set 'Layout.preferredWidth' instead of 'width' for GpsList and Preferences
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
88101e4dd3
commit
15a014105b
2 changed files with 3 additions and 3 deletions
|
@ -53,7 +53,7 @@ MobileComponents.Page {
|
||||||
}
|
}
|
||||||
MobileComponents.Label {
|
MobileComponents.Label {
|
||||||
text: date
|
text: date
|
||||||
width: Math.max(parent.width / 5, paintedWidth) // helps vertical alignment throughout listview
|
Layout.preferredWidth: Math.max(parent.width / 5, paintedWidth)
|
||||||
font.pointSize: subsurfaceTheme.smallPointSize
|
font.pointSize: subsurfaceTheme.smallPointSize
|
||||||
}
|
}
|
||||||
MobileComponents.Label {
|
MobileComponents.Label {
|
||||||
|
@ -63,7 +63,7 @@ MobileComponents.Page {
|
||||||
}
|
}
|
||||||
MobileComponents.Label {
|
MobileComponents.Label {
|
||||||
text: name
|
text: name
|
||||||
width: Math.max(parent.width / 5, paintedWidth) // helps vertical alignment throughout listview
|
Layout.preferredWidth: Math.max(parent.width / 5, paintedWidth)
|
||||||
font.pointSize: subsurfaceTheme.smallPointSize
|
font.pointSize: subsurfaceTheme.smallPointSize
|
||||||
}
|
}
|
||||||
MobileComponents.Label {
|
MobileComponents.Label {
|
||||||
|
|
|
@ -57,7 +57,7 @@ GridLayout {
|
||||||
Item { width: MobileComponents.Units.gridUnit; height: width }
|
Item { width: MobileComponents.Units.gridUnit; height: width }
|
||||||
Item {
|
Item {
|
||||||
height: saveButton.height
|
height: saveButton.height
|
||||||
width: saveButton.width
|
Layout.preferredWidth: saveButton.width
|
||||||
Button {
|
Button {
|
||||||
id: saveButton
|
id: saveButton
|
||||||
text: "Save"
|
text: "Save"
|
||||||
|
|
Loading…
Reference in a new issue