Skip to content

Commit

Permalink
task: add support for dark mode in toolbar icons
Browse files Browse the repository at this point in the history
  • Loading branch information
mfacchinelli committed Jan 10, 2025
1 parent 615de54 commit 351f319
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 5 deletions.
18 changes: 14 additions & 4 deletions app/core/+mag/+app/+manage/ToolbarManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,29 @@ function instantiate(this, parent)
% Create Toolbar.
this.Toolbar = uitoolbar(parent);

if isprop(parent, "Theme")
theme = parent.Theme.BaseColorStyle;
else
theme = "light";
end

% Create MissionPushTool.
this.MissionPushTool = uipushtool(this.Toolbar);
this.MissionPushTool.Tooltip = "Change mission";
this.MissionPushTool.ClickedCallback = @(~, ~) this.missionPushToolClicked();
this.MissionPushTool.Icon = fullfile(this.IconsPath, "mission.png");
this.MissionPushTool.Icon = this.getIconPath("mission", theme);

% Create ImportPushTool.
this.ImportPushTool = uipushtool(this.Toolbar);
this.ImportPushTool.Tooltip = "Import existing analysis";
this.ImportPushTool.ClickedCallback = @(~, ~) this.importPushToolClicked();
this.ImportPushTool.Icon = fullfile(this.IconsPath, "import.png");
this.ImportPushTool.Icon = this.getIconPath("import", theme);
this.ImportPushTool.Separator = "on";

% Create DebugToggleTool.
this.DebugToggleTool = uitoggletool(this.Toolbar);
this.DebugToggleTool.Tooltip = "Set break point at last error source";
this.DebugToggleTool.Icon = fullfile(this.IconsPath, "debug.png");
this.DebugToggleTool.Icon = this.getIconPath("debug", theme);
this.DebugToggleTool.Separator = "on";
this.DebugToggleTool.OffCallback = @(~, ~) this.debugToggleToolOff();
this.DebugToggleTool.OnCallback = @(~, ~) this.debugToggleToolOn();
Expand All @@ -54,7 +60,7 @@ function instantiate(this, parent)
this.HelpPushTool = uipushtool(this.Toolbar);
this.HelpPushTool.Tooltip = "Share debugging information with development";
this.HelpPushTool.ClickedCallback = @(~, ~) this.helpPushToolClicked();
this.HelpPushTool.Icon = fullfile(this.IconsPath, "help.png");
this.HelpPushTool.Icon = this.getIconPath("help", theme);
end

function reset(~)
Expand Down Expand Up @@ -93,6 +99,10 @@ function modelChangedCallback(~, ~, ~)

methods (Access = private)

function iconPath = getIconPath(this, iconName, theme)
iconPath = fullfile(this.IconsPath, compose("%s_%s.png", iconName, theme));
end

function missionPushToolClicked(this)
this.App.selectMission();
end
Expand Down
Binary file added app/icons/debug_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added app/icons/help_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added app/icons/import_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added app/icons/mission_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
2 changes: 1 addition & 1 deletion resources/release-notes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# App

- Add support for dark mode in mission selection background
- Add support for dark mode in toolbar icons and mission selection background
- Add checkbox in IMAP AT/SFT visualization options to show spectrograms
- Reduce duplication in definition of supported view-controllers for each mission
- Disable toolbar when selecting a mission
Expand Down

0 comments on commit 351f319

Please sign in to comment.