1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-14 14:24:10 +02:00

IDE - Close All Except / Close Tabs

This commit is contained in:
Brian Fiete 2020-09-11 17:47:38 -07:00
parent 7f3ab3878f
commit 8d934192c0
4 changed files with 52 additions and 21 deletions

View file

@ -5342,8 +5342,9 @@ namespace IDE
//////////
mWindowMenu = root.AddMenuItem("&Window");
AddMenuItem(mWindowMenu, "&Close", "Close Window", new => UpdateMenuItem_HasActivePanel);
AddMenuItem(mWindowMenu, "&Close All", "Close All Windows");
AddMenuItem(mWindowMenu, "&Close", "Close Panel", new => UpdateMenuItem_HasActivePanel);
AddMenuItem(mWindowMenu, "&Close All", "Close All Panels");
AddMenuItem(mWindowMenu, "Close All Except Current", "Close All Panels Except");
AddMenuItem(mWindowMenu, "&New View into File", "View New", new => UpdateMenuItem_HasActiveDocument);
AddMenuItem(mWindowMenu, "&Split View", "View Split", new => UpdateMenuItem_HasActiveDocument);
@ -6484,15 +6485,20 @@ namespace IDE
CloseDocument(activePanel);
}
void TryCloseAllDocuments()
void TryCloseAllDocuments(bool closeCurrent)
{
var docPanels = scope List<Widget>();
Widget skipDocumentPanel = null;
if (!closeCurrent)
skipDocumentPanel = GetActiveDocumentPanel();
WithTabs(scope [&] (tab) =>
{
if ((tab.mContent is SourceViewPanel) || (tab.mTabbedView.mIsFillWidget))
{
docPanels.Add(tab.mContent);
{
if (tab.mContent != skipDocumentPanel)
docPanels.Add(tab.mContent);
}
});