@@ -11,9 +11,10 @@ import {
1111 DeviceListState , TroubleshootingState , UserEditorState , RangeEditorState , SingleStepState ,
1212 PermissionEditorState , MBREditorState , SettingsState , ChangePasswordState
1313} from "state.slint" ;
14- import { Button , Spinner , Palette } from "std-widgets.slint" ;
14+ import { Button , Palette } from "std-widgets.slint" ;
1515import { DevicePage } from "pages/device_page.slint" ;
1616import { UnavailableDevicesPage } from "pages/unavailable_devices_page.slint" ;
17+ import { Theme } from "data/theme.slint" ;
1718import { Status } from "data/status.slint" ;
1819import { StatusIndicator } from "widgets/progress.slint" ;
1920import { PaletteExtra , Island } from "widgets/visual.slint" ;
@@ -60,6 +61,33 @@ component DriveTabView {
6061 }
6162 }
6263 }
64+
65+ Island {
66+ width : 42px ;
67+ height : 32px ;
68+ IconButton {
69+ width : 100% ;
70+ height : 100% ;
71+ icon : {
72+ if SettingsState.theme == Theme.dark {
73+ Icons.dark-mode
74+ } else if SettingsState.theme == Theme.light {
75+ Icons.light-mode
76+ } else {
77+ Icons.contrast
78+ }
79+ };
80+ clicked => {
81+ if SettingsState.theme == Theme.dark {
82+ SettingsState.theme = Theme.light
83+ } else if SettingsState.theme == Theme.light {
84+ SettingsState.theme = Theme.system
85+ } else {
86+ SettingsState.theme = Theme.dark
87+ }
88+ }
89+ }
90+ }
6391 }
6492
6593 AlternativeLayout {
@@ -139,14 +167,11 @@ component LoadingView {
139167}
140168
141169export component AppWindow inherits Window {
142- title : "SED Manager " ;
170+ title : "SEDManager " ;
143171 icon : Icons.sed-manager;
144172 preferred-width : 960px ;
145173 preferred-height : 600px ;
146174 private property <bool > loaded : DeviceListState.extended-status.status == Status.success && DeviceListState.tab-names.length != 0 ;
147- public function show-license () {
148- license-popup.visible = true ;
149- }
150175 callback quit ();
151176 VerticalLayout {
152177 if loaded: DriveTabView { }
@@ -157,11 +182,10 @@ export component AppWindow inherits Window {
157182 preferred-width : 100% ;
158183 preferred-height : 100% ;
159184 license-text : SettingsState.license-text;
160- license-changed : SettingsState.license-changed ;
161- visible : false ;
185+ license-changed : ! SettingsState.accepted- license-fingerprint.is-empty ;
186+ visible : SettingsState.accepted-license-fingerprint != SettingsState.license-fingerprint ;
162187 accept => {
163- self .visible = false ;
164- SettingsState.accept-license ();
188+ SettingsState.accepted-license-fingerprint = SettingsState.license-fingerprint;
165189 }
166190 decline => {
167191 quit ();
0 commit comments