Added Auto-Hide tab unpin context menu entry

This commit is contained in:
Uwe Kindler 2023-07-10 10:18:09 +02:00
parent 6924e69b6b
commit df1bc94d9e
2 changed files with 15 additions and 1 deletions

View File

@ -393,6 +393,8 @@ void CAutoHideTab::contextMenuEvent(QContextMenuEvent* ev)
d->createAutoHideToAction(tr("Right"), SideBarRight, menu); d->createAutoHideToAction(tr("Right"), SideBarRight, menu);
d->createAutoHideToAction(tr("Bottom"), SideBarBottom, menu); d->createAutoHideToAction(tr("Bottom"), SideBarBottom, menu);
Action = Menu.addAction(tr("Unpin (Dock)"), this, SLOT(unpinDockWidget()));
Menu.exec(ev->globalPos()); Menu.exec(ev->globalPos());
} }
@ -400,7 +402,14 @@ void CAutoHideTab::contextMenuEvent(QContextMenuEvent* ev)
//============================================================================ //============================================================================
void CAutoHideTab::setDockWidgetFloating() void CAutoHideTab::setDockWidgetFloating()
{ {
dockWidget()->setFloating(); d->DockWidget->setFloating();
}
//============================================================================
void CAutoHideTab::unpinDockWidget()
{
d->DockWidget->setAutoHide(false);
} }

View File

@ -145,6 +145,11 @@ public Q_SLOTS:
* Set the dock widget floating, if it is floatable * Set the dock widget floating, if it is floatable
*/ */
void setDockWidgetFloating(); void setDockWidgetFloating();
/**
* Unpin and dock the auto hide widget
*/
void unpinDockWidget();
}; // class AutoHideTab }; // class AutoHideTab
} }
// namespace ads // namespace ads