mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-29 12:55:59 +02:00
Right-click close options for tabs
This commit is contained in:
parent
578e513196
commit
c04778ec5a
3 changed files with 44 additions and 34 deletions
|
@ -390,6 +390,37 @@ namespace Beefy.widgets
|
|||
return ThemeFactory.mDefault.CreateTabbedView(sharedData);
|
||||
}
|
||||
|
||||
public void CloseTabs(bool autoClose, bool closeCurrent)
|
||||
{
|
||||
let prevAutoClose = mAutoClose;
|
||||
mAutoClose = autoClose;
|
||||
var tabs = scope List<TabButton>();
|
||||
for (var tab in mTabs)
|
||||
tabs.Add(tab);
|
||||
|
||||
if (tabs.IsEmpty)
|
||||
{
|
||||
if (autoClose)
|
||||
{
|
||||
if (var dockingFrame = mParent as DockingFrame)
|
||||
{
|
||||
dockingFrame.RemoveDockedWidget(this);
|
||||
BFApp.sApp.DeferDelete(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (var tab in tabs)
|
||||
{
|
||||
if ((!closeCurrent) && (tab.mIsActive))
|
||||
continue;
|
||||
tab.mCloseClickedEvent();
|
||||
}
|
||||
}
|
||||
mAutoClose = prevAutoClose;
|
||||
}
|
||||
|
||||
public void Closed()
|
||||
{
|
||||
mSharedData.mTabbedViewClosed(this);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue