File tree Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ qt_add_qml_module(${APP_TARGET}
17
17
qml/main.qml
18
18
qml/dialogs/AboutDialog.qml
19
19
qml/dialogs/ProjectSettingsDialog.qml
20
+ qml/dialogs/PreferencesDialog.qml
20
21
)
21
22
22
23
set (QML_IMPORT_PATH "${QML_IMPORT_PATH} ;${CMAKE_CURRENT_LIST_DIR} "
Original file line number Diff line number Diff line change
1
+ // SPDX-License-Identifier: GPL-3.0-or-later
2
+
3
+ import QtQuick
4
+ import QtQuick.Controls
5
+ import QtQuick.Layouts
6
+ import ScratchCPP.Global
7
+ import ScratchCPP.Ui
8
+ import ScratchCPP.UiComponents
9
+
10
+ CustomDialog {
11
+ title: qsTr (" Preferences" )
12
+ standardButtons: Dialog .Cancel | Dialog .Ok
13
+ onOpened: Settings .freeze ()
14
+ onAccepted: Settings .saveChanges ()
15
+ onRejected: {
16
+ Settings .discardChanges ();
17
+ ThemeEngine .reloadTheme ();
18
+ }
19
+
20
+ contentItem: ColumnLayout {
21
+ // Themes
22
+ Label {
23
+ text: qsTr (" Themes" )
24
+ font .pointSize : 14
25
+ font .bold : true
26
+ }
27
+
28
+ RowLayout {
29
+ RadioButton {
30
+ text: qsTr (" Light" )
31
+ checked: ThemeEngine .theme === ThemeEngine .LightTheme
32
+ onCheckedChanged: if (checked) ThemeEngine .theme = ThemeEngine .LightTheme
33
+ }
34
+
35
+ RadioButton {
36
+ text: qsTr (" Dark" )
37
+ checked: ThemeEngine .theme === ThemeEngine .DarkTheme
38
+ onCheckedChanged: if (checked) ThemeEngine .theme = ThemeEngine .DarkTheme
39
+ }
40
+ }
41
+ }
42
+ }
You can’t perform that action at this time.
0 commit comments