This repository has been archived on 2021-06-24. You can view files and clone it, but cannot push or open issues or pull requests.
ui/qml/panes/SettingsPane.qml

131 lines
2.6 KiB
QML
Raw Normal View History

2018-11-22 00:01:17 +00:00
import QtGraphicalEffects 1.0
import QtQuick 2.7
import QtQuick.Controls 2.4
import QtQuick.Controls.Material 2.0
import QtQuick.Layouts 1.3
import QtQuick.Window 2.11
2019-02-12 22:47:23 +00:00
import QtQuick.Controls 1.4
2018-11-22 00:01:17 +00:00
import "../widgets"
2019-03-18 23:52:46 +00:00
import "../widgets/controls"
2018-11-22 00:01:17 +00:00
ColumnLayout { // settingsPane
2019-04-16 19:40:19 +00:00
id: root
2018-11-22 00:01:17 +00:00
anchors.fill: parent
StackToolbar {
2019-04-16 19:40:19 +00:00
id: stb
//: Cwtch Settings title
text: qsTr("cwtch-settings-title")
2018-11-22 00:01:17 +00:00
aux.visible: false
2019-04-16 19:40:19 +00:00
membership.visible: false
2018-11-22 00:01:17 +00:00
}
2019-04-16 19:40:19 +00:00
Flickable {
anchors.top: stb.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
boundsBehavior: Flickable.StopAtBounds
clip:true
contentWidth: tehcol.width
contentHeight: tehcol.height
2019-02-12 22:47:23 +00:00
Column {
2019-04-16 19:40:19 +00:00
id: tehcol
2019-02-12 22:47:23 +00:00
leftPadding: 10
spacing: 5
2019-04-16 19:40:19 +00:00
width: root.width
2019-02-12 22:47:23 +00:00
ScalingLabel {
2019-04-16 19:40:19 +00:00
width: parent.width
wrapMode: TextEdit.Wrap
//: Version: %1 Built on: %2
text: qsTr("version %1 builddate %2").arg(gcd.version).arg(gcd.buildDate)
}
2018-11-22 00:01:17 +00:00
ScalingLabel {
2019-04-16 19:40:19 +00:00
width: parent.width
wrapMode: TextEdit.Wrap
//: Interface zoom (mostly affects text and button sizes)
text: qsTr("zoom-label") + ":"
2018-11-22 00:01:17 +00:00
}
Slider {
id: zoomSlider
2019-02-12 22:47:23 +00:00
minimumValue: 0.5
2019-02-14 02:53:36 +00:00
maximumValue: 4.0
value: gcd.themeScale
2019-02-12 22:47:23 +00:00
updateValueWhileDragging: false
onValueChanged: {
gcd.themeScale = zoomSlider.value
2019-03-18 23:52:46 +00:00
saveSettings()
}
2019-02-14 02:53:36 +00:00
width: 400
2018-11-22 00:01:17 +00:00
}
ScalingLabel {
2019-04-16 19:40:19 +00:00
wrapMode: TextEdit.Wrap
text: qsTr("large-text-label")
2018-11-22 00:01:17 +00:00
size: 20
}
ScalingLabel{
2019-04-16 19:40:19 +00:00
width: parent.width
wrapMode: TextEdit.Wrap
//: "Default size text (scale factor: "
2019-04-16 19:40:19 +00:00
text: qsTr("default-scaling-text") + " " + Math.round(zoomSlider.value * 100) / 100 + ")"
2018-11-22 00:01:17 +00:00
}
ScalingLabel {
text: qsTr("small-text-label")
2018-11-22 00:01:17 +00:00
size: 8
}
2019-03-25 20:21:32 +00:00
GridLayout {
columns: 2
columnSpacing: 10
FlagButton {
emoji: "1f1e9-1f1ea"
locale: "de"
}
FlagButton {
emoji: "1f1e8-1f1e6"
locale: "en"
selected: true
}
FlagButton {
locale: "fr"
emoji: "1f1eb-1f1f7"
}
FlagButton {
locale: "pt"
emoji: "1f1e7-1f1f7"
}
2019-03-18 23:52:46 +00:00
}
2019-02-12 22:47:23 +00:00
}//end of column with padding
2019-04-16 19:40:19 +00:00
}//end of flickable
2018-11-22 00:01:17 +00:00
2019-03-18 23:52:46 +00:00
function saveSettings() {
// language switcher saves itself because erinn is a bad (read: amazing) programmer
gcd.saveSettings(zoomSlider.value, "")
}
Connections {
target: gcd
onSupplySettings: function(zoom, locale) {
if (zoom != "") zoomSlider.value = zoom
// (locale is handled automatically by FlagButton)
}
2018-11-22 00:01:17 +00:00
}
}