1
0
Fork 0

Launcher: disable grid mode for update tab

Since the UI doesn’t work well in grid mode, and the list of updates
is limited, force list mode for the updates tab.

https://sourceforge.net/p/flightgear/codetickets/2172/
This commit is contained in:
James Turner 2020-03-17 09:58:29 +00:00
parent d52f1b5d47
commit cf8ec5998e

View file

@ -28,6 +28,7 @@ FocusScope
width: parent.width width: parent.width
GridToggleButton { GridToggleButton {
id: gridModeToggle
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: Style.margin anchors.leftMargin: Style.margin
@ -132,7 +133,8 @@ FocusScope
Loader { Loader {
id: aircraftContent id: aircraftContent
source: _launcher.aircraftGridMode ? "qrc:///qml/AircraftGridView.qml" // we use gridModeToggle vis to mean enabled, effectively
source: (gridModeToggle.visible && _launcher.aircraftGridMode) ? "qrc:///qml/AircraftGridView.qml"
: "qrc:///qml/AircraftListView.qml" : "qrc:///qml/AircraftListView.qml"
anchors { anchors {
@ -186,6 +188,10 @@ FocusScope
__model: _launcher.installedAircraftModel __model: _launcher.installedAircraftModel
__header: emptyHeader __header: emptyHeader
} }
PropertyChanges {
target: gridModeToggle; visible: true
}
}, },
State { State {
@ -195,6 +201,10 @@ FocusScope
__model: _launcher.searchAircraftModel __model: _launcher.searchAircraftModel
__header: emptyHeader __header: emptyHeader
} }
PropertyChanges {
target: gridModeToggle; visible: true
}
}, },
State { State {
@ -204,6 +214,10 @@ FocusScope
__model: _launcher.browseAircraftModel __model: _launcher.browseAircraftModel
__header: _addOns.showNoOfficialHangar ? noDefaultCatalogHeader : ratingsHeader __header: _addOns.showNoOfficialHangar ? noDefaultCatalogHeader : ratingsHeader
} }
PropertyChanges {
target: gridModeToggle; visible: true
}
}, },
State { State {
@ -213,6 +227,10 @@ FocusScope
__model: _launcher.aircraftWithUpdatesModel __model: _launcher.aircraftWithUpdatesModel
__header: (_launcher.aircraftWithUpdatesModel.count > 0) ? updateAllHeader : emptyHeader __header: (_launcher.aircraftWithUpdatesModel.count > 0) ? updateAllHeader : emptyHeader
} }
PropertyChanges {
target: gridModeToggle; visible: false
}
} }
] ]