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
@@ -64,6 +65,27 @@ Button {
64
65
text: qsTr (" Recommended" )
65
66
}
66
67
}
68
+ Loader {
69
+ Layout .topMargin : 12
70
+ Layout .fillWidth : true
71
+ active: button .customDir .length > 0
72
+ visible: active
73
+ sourceComponent: Button {
74
+ id: container
75
+ background: Rectangle {
76
+ color: Theme .color .neutral2
77
+ radius: 5
78
+ }
79
+ font .family : " Inter"
80
+ font .styleName : " Semi Bold"
81
+ font .pixelSize : 13
82
+ contentItem: Text {
83
+ font: container .font
84
+ color: Theme .color .neutral9
85
+ text: button .customDir
86
+ }
87
+ }
88
+ }
67
89
}
68
90
Item {
69
91
height: parent .height
You can’t perform that action at this time.
0 commit comments