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 @@ -11,6 +11,7 @@ Button {
11
11
property string description
12
12
property bool recommended: false
13
13
property string image: " "
14
+ property string customDir: " "
14
15
padding: 15
15
16
checkable: true
16
17
implicitWidth: 450
@@ -80,6 +81,27 @@ Button {
80
81
}
81
82
}
82
83
}
84
+ Loader {
85
+ Layout .topMargin : 12
86
+ Layout .fillWidth : true
87
+ active: button .customDir .length > 0
88
+ visible: active
89
+ sourceComponent: Button {
90
+ id: container
91
+ background: Rectangle {
92
+ color: Theme .color .neutral2
93
+ radius: 5
94
+ }
95
+ font .family : " Inter"
96
+ font .styleName : " Semi Bold"
97
+ font .pixelSize : 13
98
+ contentItem: Text {
99
+ font: container .font
100
+ color: Theme .color .neutral9
101
+ text: button .customDir
102
+ }
103
+ }
104
+ }
83
105
}
84
106
Item {
85
107
height: parent .height
You can’t perform that action at this time.
0 commit comments