-
Notifications
You must be signed in to change notification settings - Fork 103
/
OptionsDialog.qml
62 lines (50 loc) · 1.4 KB
/
OptionsDialog.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import QtQml.Models
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import Slate
Dialog {
id: dialog
objectName: "optionsDialog"
modal: true
focus: true
implicitWidth: 500
implicitHeight: 400
standardButtons: Dialog.Ok | Dialog.Cancel
onAccepted: applyChangesToSettings()
// We used to use onRejected here, but if the settings changes outside of our control
// (e.g. through being reset during testing) then some controls will contain outdated
// values since clearChanges() won't be called in that case.
onAboutToShow: revertToOldSettings()
function applyChangesToSettings() {
appearanceTab.applyChangesToSettings()
behaviourTab.applyChangesToSettings()
}
function revertToOldSettings() {
appearanceTab.revertToOldSettings()
behaviourTab.revertToOldSettings()
}
header: TabBar {
id: tabBar
// For the Universal style.
clip: true
TabButton {
objectName: "appearanceTabButton"
text: qsTr("Appearance")
}
TabButton {
objectName: "behaviourTabButton"
text: qsTr("Behaviour")
}
}
StackLayout {
anchors.fill: parent
currentIndex: tabBar.currentIndex
AppearanceTab {
id: appearanceTab
}
BehaviourTab {
id: behaviourTab
}
}
}