Skip to content

Commit

Permalink
Add more spacing options and change layout defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
Bionus committed Nov 2, 2020
1 parent 7419e20 commit 1785263
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
5 changes: 4 additions & 1 deletion src/gui-qml/src/components/ResultsView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@ ScrollView {
property double thumbnailHeightToWidthRatio: 0
property int thumbnailSpacing: 0
property int thumbnailRadius: 0
property bool thumbnailPadding: false
property var thumbnailFillMode: Image.PreserveAspectFit

contentHeight: resultsLayout.contentHeight
clip: true
padding: root.thumbnailSpacing / 2
padding: thumbnailPadding
? root.thumbnailSpacing / 2
: -root.thumbnailSpacing / 2

ColumnFlow {
id: resultsLayout
Expand Down
3 changes: 2 additions & 1 deletion src/gui-qml/src/components/SearchScreen.qml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ Page {
ResultsView {
results: searchTab.results
thumbnailHeightToWidthRatio: gSettings.resultsLayoutType.value === "flow" ? 0 : gSettings.resultsHeightToWidthRatio.value
thumbnailSpacing: gSettings.resultsAddSpaceBetweenImages.value ? 8 : 0
thumbnailSpacing: gSettings.resultsSpaceBetweenImages.value === "none" ? 0 : (gSettings.resultsSpaceBetweenImages.value === "minimal" ? 2 : 8)
thumbnailPadding: gSettings.resultsSpaceBetweenImages.value === "medium"
thumbnailRadius: gSettings.resultsRoundImages.value ? 8 : 0
thumbnailFillMode: gSettings.resultsLayoutType.value === "grid" && gSettings.resultsThumbnailFillMode.value === "crop" ? Image.PreserveAspectCrop : Image.PreserveAspectFit
Layout.fillHeight: true
Expand Down
8 changes: 4 additions & 4 deletions src/gui-qml/src/components/settings/Settings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ Item {
def: "flow"
obj: root.obj
}
property Setting resultsAddSpaceBetweenImages: Setting {
key: "resultsAddSpaceBetweenImages"
def: true
property Setting resultsSpaceBetweenImages: Setting {
key: "resultsSpaceBetweenImages"
def: "minimal"
obj: root.obj
}
property Setting resultsHeightToWidthRatio: Setting {
Expand All @@ -44,7 +44,7 @@ Item {
}
property Setting resultsRoundImages: Setting {
key: "resultsRoundImages"
def: true
def: false
obj: root.obj
}
property Setting save_filename: Setting {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,11 @@ ColumnLayout {
Layout.fillWidth: true
visible: gSettings.resultsLayoutType.value === "grid"
}
CheckBoxSetting {
ComboSetting {
name: qsTr("Spaced grid")
subtitle: qsTr("Add space between thumbnails.")
setting: gSettings.resultsAddSpaceBetweenImages
options: ["None", "Minimal", "Medium"]
values: ["none", "minimal", "medium"]
setting: gSettings.resultsSpaceBetweenImages
Layout.fillWidth: true
}
CheckBoxSetting {
Expand Down

0 comments on commit 1785263

Please sign in to comment.