File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change 5
5
import QtQuick 2.15
6
6
import QtQuick.Controls 2.15
7
7
import QtQuick.Layouts 1.15
8
+ import QtQuick.Dialogs 1.3
8
9
import "../controls"
9
10
10
11
ColumnLayout {
@@ -21,9 +22,23 @@ ColumnLayout {
21
22
checked: true
22
23
}
23
24
OptionButton {
25
+ id: customDirOption
24
26
Layout .fillWidth : true
25
27
ButtonGroup .group : group
26
28
text: qsTr (" Custom" )
27
29
description: qsTr (" Choose the directory and storage device." )
30
+ customDir: fileDialog .folder
31
+ onClicked: fileDialog .open ()
28
32
}
33
+
34
+ FileDialog {
35
+ id: fileDialog
36
+ title: qsTr (" Please choose a directory" )
37
+ selectFolder: true
38
+ folder: shortcuts .home
39
+ onAccepted: {
40
+ customDirOption .customDir = fileDilog .folder
41
+ }
42
+ }
43
+
29
44
}
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import QtQuick.Layouts 1.15
9
9
Button {
10
10
property string description
11
11
property bool recommended: false
12
+ property string customDir: " "
12
13
id: button
13
14
padding: 15
14
15
checkable: true
@@ -66,6 +67,27 @@ Button {
66
67
}
67
68
}
68
69
}
70
+ Loader {
71
+ Layout .topMargin : 12
72
+ Layout .fillWidth : true
73
+ active: button .customDir .length > 0
74
+ visible: active
75
+ sourceComponent: Button {
76
+ id: container
77
+ background: Rectangle {
78
+ color: Theme .color .neutral2
79
+ radius: 5
80
+ }
81
+ font .family : " Inter"
82
+ font .styleName : " Semi Bold"
83
+ font .pixelSize : 13
84
+ contentItem: Text {
85
+ font: container .font
86
+ color: Theme .color .neutral9
87
+ text: button .customDir
88
+ }
89
+ }
90
+ }
69
91
}
70
92
Item {
71
93
height: parent .height
You can’t perform that action at this time.
0 commit comments