forked from qt-creator/qt-creator
ADS: Integrate newest base repository commits
* Add drag and drop to auto hide Base repository was merged until commit 65600a4dcd072fd2773b661823816db6392c34eb Change-Id: I09dd6613869368d3cf0c701055a6972db915561d Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
committed by
Henning Gründl
parent
16ef838f23
commit
bb635325e7
@@ -409,6 +409,11 @@ bool DockWidget::isAutoHide() const
|
||||
return !d->m_sideTabWidget.isNull();
|
||||
}
|
||||
|
||||
SideBarLocation DockWidget::autoHideLocation() const
|
||||
{
|
||||
return isAutoHide() ? autoHideDockContainer()->sideBarLocation() : SideBarNone;
|
||||
}
|
||||
|
||||
bool DockWidget::isFloating() const
|
||||
{
|
||||
if (!isInFloatingContainer())
|
||||
@@ -746,7 +751,10 @@ void DockWidget::setFloating()
|
||||
if (isClosed())
|
||||
return;
|
||||
|
||||
d->m_tabWidget->detachDockWidget();
|
||||
if (isAutoHide())
|
||||
dockAreaWidget()->setFloating();
|
||||
else
|
||||
d->m_tabWidget->detachDockWidget();
|
||||
}
|
||||
|
||||
void DockWidget::deleteDockWidget()
|
||||
@@ -764,6 +772,15 @@ void DockWidget::closeDockWidget()
|
||||
closeDockWidgetInternal(true);
|
||||
}
|
||||
|
||||
void DockWidget::requestCloseDockWidget()
|
||||
{
|
||||
if (features().testFlag(DockWidget::DockWidgetDeleteOnClose)
|
||||
|| features().testFlag(DockWidget::CustomCloseHandling))
|
||||
closeDockWidgetInternal(false);
|
||||
else
|
||||
toggleView(false);
|
||||
}
|
||||
|
||||
bool DockWidget::closeDockWidgetInternal(bool forceClose)
|
||||
{
|
||||
if (!forceClose)
|
||||
@@ -859,21 +876,24 @@ void DockWidget::raise()
|
||||
}
|
||||
}
|
||||
|
||||
void DockWidget::setAutoHide(bool enable, SideBarLocation location)
|
||||
void DockWidget::setAutoHide(bool enable, SideBarLocation location, int tabIndex)
|
||||
{
|
||||
if (!DockManager::testAutoHideConfigFlag(DockManager::AutoHideFeatureEnabled))
|
||||
return;
|
||||
|
||||
// Do nothing if nothing changes
|
||||
if (enable == isAutoHide())
|
||||
if (enable == isAutoHide() && location == autoHideLocation())
|
||||
return;
|
||||
|
||||
auto dockArea = dockAreaWidget();
|
||||
|
||||
if (!enable) {
|
||||
dockArea->setAutoHide(false);
|
||||
} else if (isAutoHide()) {
|
||||
autoHideDockContainer()->moveToNewSideBarLocation(location);
|
||||
} else {
|
||||
auto area = (SideBarNone == location) ? dockArea->calculateSideTabBarArea() : location;
|
||||
dockContainer()->createAndSetupAutoHideContainer(area, this);
|
||||
dockContainer()->createAndSetupAutoHideContainer(area, this, tabIndex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user