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

Respect 'Permanent' on TabbedViews when dragging tabs out

TabbedViews now remain open when a single remaining tab is dragged
out of the view when the DockedWidget has 'mAutoClose = false'. This
also applies to views of secondary windows which now remain open and
empty when permanent. In this case, the full window visual no longer
participates in the drag when a single tab is dragged out.
This commit is contained in:
Joseph Battelle 2021-02-07 21:33:53 -08:00
parent eddbf7a984
commit 0d57e54033

View file

@ -200,7 +200,8 @@ namespace Beefy.widgets
{
return (mTabbedView.mParentDockingFrame.mParentDockingFrame == null) &&
(mTabbedView.mParentDockingFrame.GetDockedWindowCount() == 1) &&
(mTabbedView.GetTabCount() == 1);
(mTabbedView.GetTabCount() == 1) &&
mTabbedView.mAutoClose;
}
void WindowDragLostFocusHandler(BFWindow window, BFWindow newFocus)
@ -288,7 +289,7 @@ namespace Beefy.widgets
if ((refWidget != null) && (refWidget.mWidgetWindow != mWidgetWindow) && (mWidgetWindow != null))
mWidgetWindow.SetForeground();
if (mTabbedView.GetTabCount() == 1)
if ((mTabbedView.GetTabCount() == 1) && mTabbedView.mAutoClose)
{
mTabbedView.Dock(frame, refWidget, align);
return;
@ -327,7 +328,7 @@ namespace Beefy.widgets
tabbedView.Dock(frame, refWidget, align);
}
if (prevTabbedView.GetTabCount() == 0)
if ((prevTabbedView.GetTabCount() == 0) && prevTabbedView.mAutoClose)
{
prevTabbedView.mParentDockingFrame.RemoveDockedWidget(prevTabbedView);
}