Skip to content

Commit

Permalink
Add separate setting for landscape results column count
Browse files Browse the repository at this point in the history
  • Loading branch information
Bionus committed Nov 2, 2020
1 parent d3b363d commit 7419e20
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/gui-qml/src/components/ResultsView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ ScrollView {
id: resultsLayout

anchors.fill: parent
columns: gSettings.resultsColumnCount.value
columns: window.width > window.height
? gSettings.resultsColumnCountLandscape.value
: gSettings.resultsColumnCountPortrait.value
model: results

onColumnsChanged: resultsRefresher.restart()
Expand Down
9 changes: 7 additions & 2 deletions src/gui-qml/src/components/settings/Settings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,16 @@ Item {
def: "English"
obj: root.obj
}
property Setting resultsColumnCount: Setting {
key: "resultsColumnCount"
property Setting resultsColumnCountPortrait: Setting {
key: "resultsColumnCountPortrait"
def: 3
obj: root.obj
}
property Setting resultsColumnCountLandscape: Setting {
key: "resultsColumnCountLandscape"
def: 5
obj: root.obj
}
property Setting resultsLayoutType: Setting {
key: "resultsLayoutType"
def: "flow"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,17 @@ ColumnLayout {
text: qsTr("Search results")
}
SpinBoxSetting {
name: qsTr("Columns")
name: qsTr("Columns (portrait)")
min: 1
max: 10
setting: gSettings.resultsColumnCount
setting: gSettings.resultsColumnCountPortrait
Layout.fillWidth: true
}
SpinBoxSetting {
name: qsTr("Columns (landscape)")
min: 1
max: 10
setting: gSettings.resultsColumnCountLandscape
Layout.fillWidth: true
}
RadioSetting {
Expand Down

0 comments on commit 7419e20

Please sign in to comment.