Gui: Add dragging support for custom ToolBarAreas

This adds dragging support for toolbars placed in custom toolbar areas.
It is achived by creating our own custom ToolBar class that handles
logic of providing custom gripper. This is required because Qt hides
gripper when toolbar is not direct child of the main window which cannot
be overriden. Custom class should allow us to create more capable
toolbars in the future so it should be great addition on its own.

Co-Authored-By: Kacper Donat <kacper@kadet.net>
This commit is contained in:
Zheng, Lei
2024-06-02 16:11:14 +02:00
committed by Kacper Donat
parent f310d2bd67
commit dcfe3e8868
4 changed files with 324 additions and 108 deletions

View File

@@ -813,14 +813,6 @@ QMenu* MainWindow::createPopupMenu ()
populateDockWindowMenu(menu);
menu->addSeparator();
populateToolBarMenu(menu);
QMenu *undockMenu = new QMenu(menu);
ToolBarManager::getInstance()->populateUndockMenu(undockMenu);
if (undockMenu->actions().isEmpty()) {
delete undockMenu;
}
else {
menu->addMenu(undockMenu);
}
menu->addSeparator();
Workbench* wb = WorkbenchManager::instance()->active();
if (wb) {