mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
QML UI: DiveDetailsView - set fixed column widths
In order for wrapping to work, the Text and TextEdit elements need to have a defined width. Normally the GridLayout is supposed to be able to figure out optimal widths for the different colums if you tell it which ones should stretch, but that has repeatedly caused infinite loops and crashes in the layout engine. For now, in order to get both wrapping (and therefore no clipping of the content) and avoid crashes, we hard code the width of the four columns by setting Layout.maxWidth for each element in the first row of the grid. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
c6a844fbad
commit
3e46361518
1 changed files with 5 additions and 0 deletions
|
@ -139,28 +139,33 @@ Item {
|
|||
Layout.columnSpan: 4
|
||||
}
|
||||
|
||||
// first row - here we set up the column widths - total is 90% of width
|
||||
MobileComponents.Label {
|
||||
text: "Suit:"
|
||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
opacity: 0.6
|
||||
Layout.maximumWidth: subsurfaceTheme.columnWidth * 0.18
|
||||
Layout.alignment: Qt.AlignRight
|
||||
}
|
||||
MobileComponents.Label {
|
||||
id: txtSuit
|
||||
text: dive.suit
|
||||
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
||||
Layout.maximumWidth: subsurfaceTheme.columnWidth * 0.36
|
||||
}
|
||||
|
||||
MobileComponents.Label {
|
||||
text: "Air Temp:"
|
||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
opacity: 0.6
|
||||
Layout.maximumWidth: subsurfaceTheme.columnWidth * 0.18
|
||||
Layout.alignment: Qt.AlignRight
|
||||
}
|
||||
MobileComponents.Label {
|
||||
id: txtAirTemp
|
||||
text: dive.airTemp
|
||||
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
||||
Layout.maximumWidth: subsurfaceTheme.columnWidth * 0.18
|
||||
}
|
||||
|
||||
MobileComponents.Label {
|
||||
|
|
Loading…
Add table
Reference in a new issue