Skip to content

Commit

Permalink
Add basic 'About' category in the settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Bionus committed Oct 27, 2020
1 parent e8a9291 commit 36866f8
Show file tree
Hide file tree
Showing 8 changed files with 141 additions and 36 deletions.
Binary file added src/gui-qml/resources/images/icons/info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/gui-qml/resources/images/icons/info@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/gui-qml/resources/images/icons/info@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/gui-qml/resources/images/icons/info@4x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/gui-qml/resources/resources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,9 @@
<file>images/icons/edit@2x.png</file>
<file>images/icons/edit@3x.png</file>
<file>images/icons/edit@4x.png</file>
<file>images/icons/info.png</file>
<file>images/icons/info@2x.png</file>
<file>images/icons/info@3x.png</file>
<file>images/icons/info@4x.png</file>
</qresource>
</RCC>
22 changes: 22 additions & 0 deletions src/gui-qml/src/components/settings/LinkSettingItem.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import QtQuick 2.12
import QtQuick.Controls 2.5

Item {
id: root

property alias name: item.name
property alias subtitle: item.subtitle
property string url

implicitHeight: item.implicitHeight

SettingItem {
id: item

name: root.name
subtitle: setting.value
anchors.fill: parent

onClicked: Qt.openUrlExternally(url)
}
}
150 changes: 114 additions & 36 deletions src/gui-qml/src/components/settings/SettingsScreen.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Page {

ToolButton {
icon.source: "/images/icons/back.png"
onClicked: root.closed()
onClicked: stackView.depth > 1 ? stackView.pop() : root.closed()
}

Label {
Expand All @@ -30,50 +30,128 @@ Page {
}
}

ColumnLayout {
width: parent.width
spacing: 0
StackView {
id: stackView
anchors.fill: parent
initialItem: mainSettings

SettingTitle {
Layout.fillWidth: true
text: qsTr("Interface")
}
ListView {
id: mainSettings

ComboSetting {
name: qsTr("Language")
options: ["English", "French"]
settingKey: "language"
settingDefault: "English"
Layout.fillWidth: true
model: ListModel {
ListElement {
name: qsTr("General")
icon: "/images/icons/settings.png"
}
ListElement {
name: qsTr("About")
icon: "/images/icons/info.png"
}
}
delegate: ItemDelegate {
width: parent.width

onChanged: languageLoader.setLanguage(value)
}
text: model.name
icon.source: model.icon

SettingTitle {
Layout.fillWidth: true
text: qsTr("Save")
onClicked: stackView.push(stackView.children[index + 1])
}
}

TextFieldSetting {
name: qsTr("Filename")
settingKey: "Save/filename"
settingDefault: "%md5%.%ext%"
Layout.fillWidth: true
}
ColumnLayout {
id: generalSettings
width: parent.width
spacing: 0
visible: false

SettingTitle {
Layout.fillWidth: true
text: qsTr("Interface")
}

ComboSetting {
name: qsTr("Language")
options: ["English", "French"]
settingKey: "language"
settingDefault: "English"
Layout.fillWidth: true

onChanged: languageLoader.setLanguage(value)
}

SettingTitle {
Layout.fillWidth: true
text: qsTr("Save")
}

TextFieldSetting {
name: qsTr("Filename")
settingKey: "Save/filename"
settingDefault: "%md5%.%ext%"
Layout.fillWidth: true
}

FolderSetting {
name: qsTr("Folder")
settingKey: "Save/path"
settingDefault: StandardPaths.standardLocations(StandardPaths.PicturesLocation)[0]
Layout.fillWidth: true
}

FolderSetting {
name: qsTr("Folder")
settingKey: "Save/path"
settingDefault: StandardPaths.standardLocations(StandardPaths.PicturesLocation)[0]
Layout.fillWidth: true
CheckBoxSetting {
name: qsTr("Hide blacklisted")
subtitle: qsTr("Hide blacklisted images from the results.")
settingKey: "hideblacklisted"
settingDefault: true
Layout.fillWidth: true
}

Item {
Layout.fillHeight: true
}
}

CheckBoxSetting {
name: qsTr("Hide blacklisted")
subtitle: qsTr("Hide blacklisted images from the results.")
settingKey: "hideblacklisted"
settingDefault: true
Layout.fillWidth: true
ColumnLayout {
id: aboutSettings
width: parent.width
spacing: 0
visible: false

SettingTitle {
Layout.fillWidth: true
text: qsTr("About")
}

SettingItem {
name: qsTr("Version")
subtitle: NIGHTLY
? "Nightly " + NIGHTLY_COMMIT.substring(0, 8)
: "Version " + VERSION
Layout.fillWidth: true
}

SettingTitle {
Layout.fillWidth: true
text: qsTr("Author")
}

LinkSettingItem {
name: qsTr("Email")
subtitle: "bio.nus@hotmail.fr"
url: "mailto:bio.nus@hotmail.fr"
Layout.fillWidth: true
}

LinkSettingItem {
name: qsTr("Github")
subtitle: "@Bionus"
url: "https://github.com/Bionus"
Layout.fillWidth: true
}

Item {
Layout.fillHeight: true
}
}
}
}
1 change: 1 addition & 0 deletions src/gui-qml/src/qml.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
<file>components/settings/ComboSetting.qml</file>
<file>components/settings/SourceSettingsScreen.qml</file>
<file>components/settings/SettingTitle.qml</file>
<file>components/settings/LinkSettingItem.qml</file>
</qresource>
</RCC>

0 comments on commit 36866f8

Please sign in to comment.