Skip to content

Commit 3e6c619

Browse files
devvaannshabose
authored andcommitted
feat: add support to open quick access panel
1 parent 1e0f316 commit 3e6c619

4 files changed

Lines changed: 47 additions & 11 deletions

File tree

src/nls/root/strings.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1251,11 +1251,12 @@ define({
12511251
"REFERENCES_NO_RESULTS": "No References available for current cursor position",
12521252
"REFERENCES_PANEL_TITLE": "References",
12531253
"SEARCH_RESULTS_PANEL_TITLE": "Search Results",
1254-
"BOTTOM_PANEL_HIDE": "Hide Panel",
1254+
"BOTTOM_PANEL_MINIMIZE": "Minimize Panel",
12551255
"BOTTOM_PANEL_SHOW": "Show Bottom Panel",
12561256
"BOTTOM_PANEL_HIDE_TOGGLE": "Hide Bottom Panel",
12571257
"BOTTOM_PANEL_DEFAULT_TITLE": "Quick Access",
12581258
"BOTTOM_PANEL_DEFAULT_HEADING": "Open a Panel",
1259+
"BOTTOM_PANEL_OPEN_PANEL": "Open a Panel",
12591260
"BOTTOM_PANEL_MAXIMIZE": "Maximize Panel",
12601261
"BOTTOM_PANEL_RESTORE": "Restore Panel Size",
12611262

src/styles/Extn-BottomPanelTabs.less

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,33 @@
194194
}
195195
}
196196

197+
.bottom-panel-add-btn {
198+
display: flex;
199+
align-items: center;
200+
justify-content: center;
201+
width: 1.9rem;
202+
height: 2rem;
203+
cursor: pointer;
204+
color: #888;
205+
font-size: 0.82rem;
206+
flex: 0 0 auto;
207+
transition: color 0.12s ease, background-color 0.12s ease;
208+
209+
.dark & {
210+
color: #777;
211+
}
212+
213+
&:hover {
214+
background-color: #e0e0e0;
215+
color: #333;
216+
217+
.dark & {
218+
background-color: #333;
219+
color: #eee;
220+
}
221+
}
222+
}
223+
197224
.bottom-panel-tab-bar-actions {
198225
display: flex;
199226
align-items: center;

src/view/PanelView.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -467,9 +467,9 @@ define(function (require, exports, module) {
467467
_toggleMaximize();
468468
});
469469

470-
// Double-click on tab bar toggles maximize (exclude action buttons)
470+
// Double-click on tab bar toggles maximize (exclude action buttons and add button)
471471
_$tabBar.on("dblclick", function (e) {
472-
if ($(e.target).closest(".bottom-panel-tab-close-btn, .bottom-panel-hide-btn, .bottom-panel-maximize-btn").length) {
472+
if ($(e.target).closest(".bottom-panel-tab-close-btn, .bottom-panel-hide-btn, .bottom-panel-maximize-btn, .bottom-panel-add-btn").length) {
473473
return;
474474
}
475475
_toggleMaximize();
@@ -568,12 +568,12 @@ define(function (require, exports, module) {
568568
let $btn = _$tabBar.find(".bottom-panel-maximize-btn");
569569
let $icon = $btn.find("i");
570570
if (_isMaximized) {
571-
$icon.removeClass("fa-expand")
572-
.addClass("fa-compress");
571+
$icon.removeClass("fa-regular fa-square")
572+
.addClass("fa-solid fa-window-restore");
573573
$btn.attr("title", Strings.BOTTOM_PANEL_RESTORE);
574574
} else {
575-
$icon.removeClass("fa-compress")
576-
.addClass("fa-expand");
575+
$icon.removeClass("fa-solid fa-window-restore")
576+
.addClass("fa-regular fa-square");
577577
$btn.attr("title", Strings.BOTTOM_PANEL_MAXIMIZE);
578578
}
579579
}

src/view/WorkspaceManager.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -363,16 +363,19 @@ define(function (require, exports, module) {
363363
$bottomPanelContainer = $('<div id="bottom-panel-container" class="vert-resizable top-resizer"></div>');
364364
let $bottomPanelTabBar = $('<div id="bottom-panel-tab-bar"></div>');
365365
let $bottomPanelTabsOverflow = $('<div class="bottom-panel-tabs-overflow"></div>');
366+
let $addPanelBtn = $('<span class="bottom-panel-add-btn"><i class="fa-solid fa-plus"></i></span>')
367+
.attr('title', Strings.BOTTOM_PANEL_OPEN_PANEL);
366368
let $tabBarActions = $('<div class="bottom-panel-tab-bar-actions"></div>');
367369
$tabBarActions.append(
368-
$('<span class="bottom-panel-maximize-btn"><i class="fa-solid fa-expand"></i></span>')
369-
.attr('title', Strings.BOTTOM_PANEL_MAXIMIZE)
370+
$('<span class="bottom-panel-hide-btn"><i class="fa-solid fa-minus"></i></span>')
371+
.attr('title', Strings.BOTTOM_PANEL_MINIMIZE)
370372
);
371373
$tabBarActions.append(
372-
$('<span class="bottom-panel-hide-btn"><i class="fa-solid fa-chevron-down"></i></span>')
373-
.attr('title', Strings.BOTTOM_PANEL_HIDE)
374+
$('<span class="bottom-panel-maximize-btn"><i class="fa-regular fa-square"></i></span>')
375+
.attr('title', Strings.BOTTOM_PANEL_MAXIMIZE)
374376
);
375377
$bottomPanelTabBar.append($bottomPanelTabsOverflow);
378+
$bottomPanelTabBar.append($addPanelBtn);
376379
$bottomPanelTabBar.append($tabBarActions);
377380
$bottomPanelContainer.append($bottomPanelTabBar);
378381
$bottomPanelContainer.insertBefore("#status-bar");
@@ -402,6 +405,11 @@ define(function (require, exports, module) {
402405
_statusBarToggleInProgress = false;
403406
});
404407

408+
// "+" button opens the quick access / default panel
409+
$addPanelBtn.on("click", function () {
410+
_showDefaultPanel();
411+
});
412+
405413
// Make the container resizable (not individual panels)
406414
Resizer.makeResizable($bottomPanelContainer[0], Resizer.DIRECTION_VERTICAL, Resizer.POSITION_TOP,
407415
200, false, undefined, true);

0 commit comments

Comments
 (0)