-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSettingsDialog.qml
193 lines (170 loc) · 5.13 KB
/
SettingsDialog.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
import QtQuick 2.3
import QtQuick.Controls 1.2
import QtQuick.Dialogs 1.2
Item {
id: dialogComponent
anchors.fill: parent
// Add a simple animation to fade in the popup
// let the opacity go from 0 to 1 in 400ms
PropertyAnimation { target: dialogComponent; property: "opacity";
duration: 400; from: 0; to: 1;
easing.type: Easing.InOutQuad ; running: true }
property string pictreFolderHome: ""
property int newBlurValue: appWindow.blurValue
property int newDurationValue: appWindow.showImageDuration / 1000
function acceptNewValues() {
appWindow.changeSettings(newBlurValue,newDurationValue,pictreFolderHome)
dialogComponent.destroy()
}
// This rectange is the a overlay to partially show the parent through it
// and clicking outside of the 'dialog' popup will do 'nothing'
Rectangle {
anchors.fill: parent
id: overlay
color: "#000000"
opacity: 0.6
// add a mouse area so that clicks outside
// the dialog window will not do anything
MouseArea {
anchors.fill: parent
}
}
// This rectangle is the actual popup
FileDialog {
id: fileDialog
title: "Please choose the parent folder for pictures"
selectFolder: true
folder: shortcuts.pictures
onAccepted: {
console.log("You chose: " + fileDialog.fileUrls)
Qt.quit()
}
onRejected: {
console.log("Canceled")
Qt.quit()
}
}
Rectangle {
id: dialogWindow
width: 320
height: 200
gradient: Gradient {
GradientStop {
position: 0
color: "#ffffff"
}
GradientStop {
position: 0.003
color: "#1ff3cf"
}
GradientStop {
position: 1
color: "#4c4c4c"
}
}
anchors.centerIn: parent
Text {
id: text1
x: 28
y: 41
width: 114
height: 19
text: qsTr("Background Blur Value:")
font.pointSize: 12
}
Button {
id: btnAccept
x: 28
y: 155
text: qsTr("Accept")
isDefault: true
onClicked: {
dialogComponent.destroy()
}
}
Button {
id: btnCancel
x: 215
y: 155
text: qsTr("Cancel")
onClicked: {
dialogComponent.destroy()
}
}
Button {
id: btnFolderChooser
x: 28
y: 106
width: 262
height: 43
text: qsTr("Choose Base Picture Folder")
}
Text {
id: text2
x: 28
y: 72
text: qsTr("Image Display Duration:")
font.pixelSize: 12
}
SpinBox {
id: blurValueSpinner
x: 210
y: 40
width: 80
height: 20
maximumValue: 300
}
SpinBox {
id: durationValueSpinner
x: 210
y: 75
width: 80
height: 20
}
}
}
//Item {
// id: settingsDialog
// width: 580
// height: 400
//// SystemPalette { id: palette }
//// clip: true
// PropertyAnimation { target: settingsDialog; property: "opacity";
// duration: 400; from: 0; to: 1;
// easing.type: Easing.InOutQuad ; running: true }
// FileDialog {
// id: dlgImageFolder
// folder: appWindow.pictureHome
// width: 500
// height: 300
// }
//// Dialog {
//// id: helloDialog
//// modality: dialogModal.checked ? Qt.WindowModal : Qt.NonModal
//// title: customizeTitle.checked ? windowTitleField.text : "Hello"
//// onButtonClicked: console.log("clicked button " + clickedButton)
//// onAccepted: lastChosen.text = "Accepted " +
//// (clickedButton == StandardButton.Ok ? "(OK)" : (clickedButton == StandardButton.Retry ? "(Retry)" : "(Ignore)"))
//// onRejected: lastChosen.text = "Rejected " +
//// (clickedButton == StandardButton.Close ? "(Close)" : (clickedButton == StandardButton.Abort ? "(Abort)" : "(Cancel)"))
//// onHelp: lastChosen.text = "Yelped for help!"
//// onYes: lastChosen.text = (clickedButton == StandardButton.Yes ? "Yeessss!!" : "Yes, now and always")
//// onNo: lastChosen.text = (clickedButton == StandardButton.No ? "Oh No." : "No, no, a thousand times no!")
//// onApply: lastChosen.text = "Apply"
//// onReset: lastChosen.text = "Reset"
//// Label {
//// text: "Hello world!"
//// }
//// }
// Rectangle {
// height: 40
// width: 100
// radius: 10
// anchors.centerIn: parent
// anchors.bottom: parent.bottom
// MouseArea {
// anchors.fill: parent
// onClicked: settingsDialog.destroy()
// }
// }
//}