File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -301,7 +301,32 @@ function setDefaultPropertiesForEduMode(obj)
301301 end
302302
303303 function setDefaultGUIProperties(obj )
304- theme = matRad_ThemeDark();
304+ % Detect current theme
305+ light = false ;
306+ try
307+ if ispc
308+ light = logical(winqueryreg(' HKEY_CURRENT_USER' ,' Software\\ Microsoft\\ Windows\\ CurrentVersion\\ Themes\\ Personalize' ,' AppsUseLightTheme' ));
309+ elseif ismac
310+ out = system(' defaults read -g AppleInterfaceStyle' );
311+ if ~strcmp(out ,' Dark' )
312+ light = true ;
313+ end
314+ else
315+ out = system(' gsettings get org.gnome.desktop.interface color-scheme' );
316+ if strcmp(out ,' prefer-light' )
317+ light = true ;
318+ end
319+ end
320+ catch
321+ light = false ;
322+ end
323+
324+ if light
325+ theme = matRad_ThemeLight();
326+ else
327+ theme = matRad_ThemeDark();
328+ end
329+
305330 obj.gui = struct(theme );
306331 end
307332
You can’t perform that action at this time.
0 commit comments