Removed superfluous function setDockSizeProportion()

This commit is contained in:
Uwe Kindler 2022-10-25 15:58:47 +02:00
commit 44bfc56471
3 changed files with 5 additions and 38 deletions

View File

@ -226,7 +226,6 @@ CAutoHideDockContainer::CAutoHideDockContainer(CDockWidget* DockWidget, CDockWid
CAutoHideDockContainer(DockWidget->dockManager(), area, parent)
{
addDockWidget(DockWidget);
setDockSizeProportion(DockWidget->DefaultAutoHideDockProportion());
}
@ -325,35 +324,6 @@ void CAutoHideDockContainer::addDockWidget(CDockWidget* DockWidget)
}
//============================================================================
void CAutoHideDockContainer::setDockSizeProportion(float SplitterProportion)
{
if (SplitterProportion < 0 || SplitterProportion > 1)
{
ADS_PRINT("SplitterProportion must be set between 0 and 1.");
return;
}
const auto dockSize = static_cast<int>(static_cast<float>(INT_MAX) * SplitterProportion);
const auto remainingSize = INT_MAX - dockSize;
/* switch (d->SideTabBarArea)
{
case CDockWidgetSideTab::Left:
{
setSizes({ dockSize, remainingSize });
break;
}
case CDockWidgetSideTab::Right:
case CDockWidgetSideTab::Bottom:
{
setSizes({ remainingSize, dockSize });
break;
}
}*/
}
//============================================================================
CDockWidgetSideTab::SideTabBarArea CAutoHideDockContainer::sideTabBarArea() const
{

View File

@ -97,14 +97,6 @@ public:
*/
void addDockWidget(CDockWidget* DockWidget);
/*
* Set default splitter sizes. Don't use when restoring state
* As we want the size from the XML
* Takes a float between 0 and 1
* E.g. 0.25 is a quarter of the size, 0.5 is half the size and 1 is the entire size of the container
*/
void setDockSizeProportion(float SplitterProportion = 0.25);
/**
* Returns the side tab bar area of this Auto Hide dock container
*/

View File

@ -412,6 +412,11 @@ void CDockAreaTitleBar::onUndockButtonClicked()
{
if (d->DockArea->features().testFlag(CDockWidget::DockWidgetFloatable))
{
if (d->DockArea->autoHideDockContainer())
{
d->DockArea->autoHideDockContainer()->cleanupAndDelete();
}
d->makeAreaFloating(mapFromGlobal(QCursor::pos()), DraggingInactive);
}
}