mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 23:33:24 +00:00
QML UI: better way to determine dive details edit width
Instead of passing magic values around, calculate the columnWidth as part of the SubsurfaceTheme object. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
66b08f53f2
commit
ba4bb56701
3 changed files with 2 additions and 3 deletions
|
@ -60,7 +60,6 @@ MobileComponents.Page {
|
|||
detailsEdit.buddyText = diveDetailsListView.currentItem.modelData.dive.buddy
|
||||
detailsEdit.divemasterText = diveDetailsListView.currentItem.modelData.dive.divemaster
|
||||
detailsEdit.notesText = diveDetailsListView.currentItem.modelData.dive.notes
|
||||
detailsEdit.forcedWidth = diveDetailsPage.width
|
||||
diveDetailsPage.state = "edit"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,13 +22,12 @@ Item {
|
|||
property alias durationText: txtDuration.text
|
||||
property alias depthText: txtDepth.text
|
||||
property alias weightText: txtWeight.text
|
||||
property int forcedWidth
|
||||
|
||||
height: editArea.height
|
||||
ColumnLayout {
|
||||
id: editArea
|
||||
spacing: MobileComponents.Units.smallSpacing
|
||||
width: forcedWidth
|
||||
width: subsurfaceTheme.columnWidth - 2 * MobileComponents.Units.gridUnit
|
||||
|
||||
GridLayout {
|
||||
id: editorDetails
|
||||
|
|
|
@ -209,6 +209,7 @@ MobileComponents.ApplicationWindow {
|
|||
property color accentColor: "#2d5b9a"
|
||||
property color shadedColor: "#132744"
|
||||
property color accentTextColor: "#ececec"
|
||||
property int columnWidth: Math.round(rootItem.width/(MobileComponents.Units.gridUnit*30)) > 0 ? Math.round(rootItem.width / Math.round(rootItem.width/(MobileComponents.Units.gridUnit*30))) : rootItem.width
|
||||
}
|
||||
|
||||
toolBar: TopBar {
|
||||
|
|
Loading…
Add table
Reference in a new issue