Skip to content

Commit 9f69c03

Browse files
committed
refactor(panel): use SVG icons instead of FontAwesome classes for bottom panel tabs
Replace iconClass (FontAwesome class strings) with iconSvg (SVG file paths) for all createBottomPanel callers. FA class approach caused inconsistent sizing between fa-solid and fa-brands due to font-weight/font-size quirks that required CSS overrides. SVG icons are rendered via mask-image with background-color: currentColor so they inherit the theme text color automatically — works correctly in both light and dark themes, and for active/inactive tab states. - New SVG files in src/styles/images/: panel-icon-{terminal,problems, search,git,snippets,shortcuts,default}.svg - Updated callers: Terminal, CodeInspection, SearchResultsView, Git, CustomSnippets, DisplayShortcuts, DefaultPanelView - PanelView.js and DefaultPanelView.js set mask-image inline via JS - Removed iconClass support and related CSS overrides
1 parent de1d171 commit 9f69c03

17 files changed

Lines changed: 51 additions & 54 deletions

File tree

src/extensions/default/Git/src/Panel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1240,7 +1240,7 @@ define(function (require, exports) {
12401240
var $panelHtml = $(panelHtml);
12411241
$panelHtml.find(".git-available, .git-not-available").hide();
12421242

1243-
gitPanel = WorkspaceManager.createBottomPanel("main-git.panel", $panelHtml, 100, Strings.GIT_PANEL_TITLE, {iconClass: "fa-brands fa-git-alt"});
1243+
gitPanel = WorkspaceManager.createBottomPanel("main-git.panel", $panelHtml, 100, Strings.GIT_PANEL_TITLE, {iconSvg: "styles/images/panel-icon-git.svg"});
12441244
$gitPanel = gitPanel.$panel;
12451245
const resizeObserver = new ResizeObserver(_panelResized);
12461246
resizeObserver.observe($gitPanel[0]);

src/extensionsIntegrated/CustomSnippets/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ define(function (require, exports, module) {
5959
*/
6060
function _createPanel() {
6161
customSnippetsPanel = WorkspaceManager.createBottomPanel(PANEL_ID, $snippetsPanel, PANEL_MIN_SIZE,
62-
Strings.CUSTOM_SNIPPETS_PANEL_TITLE, {iconClass: "fa-solid fa-code"});
62+
Strings.CUSTOM_SNIPPETS_PANEL_TITLE, {iconSvg: "styles/images/panel-icon-snippets.svg"});
6363
UIHelper.init(customSnippetsPanel);
6464
customSnippetsPanel.show();
6565

src/extensionsIntegrated/DisplayShortcuts/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ define(function (require, exports, module) {
479479
// AppInit.htmlReady() has already executed before extensions are loaded
480480
// so, for now, we need to call this ourself
481481
panel = WorkspaceManager.createBottomPanel(TOGGLE_SHORTCUTS_ID, $(s), 300,
482-
Strings.KEYBOARD_SHORTCUT_PANEL_TITLE, {iconClass: "fa-solid fa-keyboard"});
482+
Strings.KEYBOARD_SHORTCUT_PANEL_TITLE, {iconSvg: "styles/images/panel-icon-shortcuts.svg"});
483483
panel.hide();
484484

485485
$shortcutsPanel = $("#shortcuts-panel");

src/extensionsIntegrated/Terminal/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ define(function (require, exports, module) {
115115
};
116116

117117
$panel = $(Mustache.render(panelHTML, templateVars));
118-
panel = WorkspaceManager.createBottomPanel(PANEL_ID, $panel, PANEL_MIN_SIZE, undefined, {iconClass: "fa-solid fa-terminal"});
118+
panel = WorkspaceManager.createBottomPanel(PANEL_ID, $panel, PANEL_MIN_SIZE, undefined, {iconSvg: "styles/images/panel-icon-terminal.svg"});
119119

120120
// Override focus() so Shift+Escape can transfer focus to the terminal
121121
panel.focus = function () {

src/language/CodeInspection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1240,7 +1240,7 @@ define(function (require, exports, module) {
12401240
Editor.registerGutter(CODE_INSPECTION_GUTTER, CODE_INSPECTION_GUTTER_PRIORITY);
12411241
// Create bottom panel to list error details
12421242
var panelHtml = Mustache.render(PanelTemplate, Strings);
1243-
problemsPanel = WorkspaceManager.createBottomPanel("errors", $(panelHtml), 100, Strings.CMD_VIEW_TOGGLE_PROBLEMS, {iconClass: "fa-solid fa-triangle-exclamation"});
1243+
problemsPanel = WorkspaceManager.createBottomPanel("errors", $(panelHtml), 100, Strings.CMD_VIEW_TOGGLE_PROBLEMS, {iconSvg: "styles/images/panel-icon-problems.svg"});
12441244
$problemsPanel = $("#problems-panel");
12451245
$fixAllBtn = $problemsPanel.find(".problems-fix-all-btn");
12461246
$fixAllBtn.click(()=>{

src/search/SearchResultsView.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ define(function (require, exports, module) {
8282
const self = this;
8383
let panelHtml = Mustache.render(searchPanelTemplate, {panelID: panelID});
8484

85-
this._panel = WorkspaceManager.createBottomPanel(panelName, $(panelHtml), 100, title, {iconClass: "fa-solid fa-magnifying-glass"});
85+
this._panel = WorkspaceManager.createBottomPanel(panelName, $(panelHtml), 100, title, {iconSvg: "styles/images/panel-icon-search.svg"});
8686
this._$summary = this._panel.$panel.find(".title");
8787
this._$table = this._panel.$panel.find(".table-container");
8888
this._$previewEditor = this._panel.$panel.find(".search-editor-preview");

src/styles/Extn-BottomPanelTabs.less

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -144,31 +144,29 @@
144144
}
145145
}
146146

147-
/* Tab icon: hidden by default, shown when tabs are collapsed */
148-
.bottom-panel-tab-icon {
149-
display: none;
150-
font-size: 1rem;
151-
width: 1rem;
152-
text-align: center;
153-
pointer-events: none;
154-
}
155-
156-
/* Override any FA class specificity (e.g. fa-brands sets font-size: 1.2em) */
157-
i.panel-titlebar-icon.panel-titlebar-icon {
158-
font-size: 1rem;
159-
}
160-
161-
img.panel-titlebar-icon {
147+
/* SVG icons rendered as masks so they inherit currentColor (works with light/dark themes).
148+
The mask-image URL is set inline via JS (PanelView.js, DefaultPanelView.js). */
149+
.panel-titlebar-icon {
150+
display: inline-block;
162151
width: 1rem;
163152
height: 1rem;
164153
vertical-align: middle;
154+
background-color: currentColor;
155+
-webkit-mask-repeat: no-repeat;
156+
mask-repeat: no-repeat;
157+
-webkit-mask-position: center;
158+
mask-position: center;
159+
-webkit-mask-size: contain;
160+
mask-size: contain;
161+
pointer-events: none;
165162
}
166163

167-
.default-panel-btn i.panel-titlebar-icon {
168-
font-size: 20px;
164+
/* Tab icon: hidden by default, shown when tabs are collapsed */
165+
.bottom-panel-tab-icon {
166+
display: none;
169167
}
170168

171-
.default-panel-btn img.panel-titlebar-icon {
169+
.default-panel-btn .panel-titlebar-icon {
172170
width: 20px;
173171
height: 20px;
174172
}
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)