Skip to content

Commit ef780b4

Browse files
committed
Fixed theme code for 24b
1 parent 80eb24a commit ef780b4

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

code/launchMVCApp.m

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
% Rename the figure.
1414
f.Name = "Small MVC App";
1515

16-
% Respond to theme changes.
17-
f.ThemeChangedFcn = @onThemeChanged;
18-
1916
% Create the layout.
2017
g = uigridlayout( ...
2118
"Parent", f, ...
@@ -39,7 +36,14 @@
3936
"Parent", tb, ...
4037
"Tooltip", "Reset the data", ...
4138
"ClickedCallback", @onReset );
42-
onThemeChanged()
39+
40+
% Respond to theme changes.
41+
if isprop( f, "Theme" ) && ~isempty( f.Theme )
42+
f.ThemeChangedFcn = @onThemeChanged;
43+
onThemeChanged()
44+
else
45+
resetButton.Icon = iconLight;
46+
end % if
4347

4448
function onReset( ~, ~ )
4549
%ONRESET Callback function for the toolbar reset button.

0 commit comments

Comments
 (0)