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

151 lines
3.0 KiB
QML

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
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import "../widgets"
import "../widgets/controls"
ColumnLayout { // settingsPane
id: root
anchors.fill: parent
StackToolbar {
id: stb
//: Cwtch Settings title
text: qsTr("cwtch-settings-title")
aux.visible: false
membership.visible: false
}
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
Column {
id: tehcol
leftPadding: 10
spacing: 5
width: root.width
ScalingLabel {
width: parent.width
wrapMode: TextEdit.Wrap
//: Version: %1 Built on: %2
text: qsTr("version %1 builddate %2").arg(gcd.version).arg(gcd.buildDate)
}
ScalingLabel {
width: parent.width
wrapMode: TextEdit.Wrap
//: Interface zoom (mostly affects text and button sizes)
text: qsTr("zoom-label") + ":"
}
Slider {
id: zoomSlider
minimumValue: 0.5
maximumValue: 4.0
value: gcd.themeScale
updateValueWhileDragging: false
onValueChanged: {
gcd.themeScale = zoomSlider.value
saveSettings()
}
width: 400
}
CheckBox {
id: blockUnknownToggle
checked: true
onClicked: {
if (blockUnknownToggle.checked) {
gcd.blockUnknownPeers()
} else {
gcd.allowUnknownPeers()
}
}
style: CheckBoxStyle {
label: ScalingLabel {
text: qsTr("block-unknown-label")
}
}
}
ScalingLabel {
wrapMode: TextEdit.Wrap
text: qsTr("large-text-label")
size: 20
}
ScalingLabel{
width: parent.width
wrapMode: TextEdit.Wrap
//: "Default size text (scale factor: "
text: qsTr("default-scaling-text") + " " + Math.round(zoomSlider.value * 100) / 100 + ")"
}
ScalingLabel {
text: qsTr("small-text-label")
size: 8
}
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"
}
}
}//end of column with padding
}//end of flickable
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, blockunknown) {
if (zoom != "") zoomSlider.value = zoom
// (locale is handled automatically by FlagButton)
blockUnknownToggle.checked = blockunknown
}
}
}