Skip to content

Commit 6e716bb

Browse files
authored
Merge branch 'dev' into dev
2 parents 62fde50 + 8171104 commit 6e716bb

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

matRad/MatRad_Config.m

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)