Commit 46ecaecc authored by con's avatar con
Browse files

Remove dock widget handles from debugger tool bar.

Otherwise it's possible to remove the tool bar without ever getting it
back.
parent c3d75e66
......@@ -119,14 +119,16 @@ void FancyMainWindow::updateDockWidget(QDockWidget *dockWidget)
const QDockWidget::DockWidgetFeatures features =
(d->m_locked) ? QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetFloatable
: QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetFloatable;
QWidget *titleBarWidget = dockWidget->titleBarWidget();
if (d->m_locked && !titleBarWidget && !dockWidget->isFloating())
titleBarWidget = new QWidget(dockWidget);
else if ((!d->m_locked || dockWidget->isFloating()) && titleBarWidget) {
delete titleBarWidget;
titleBarWidget = 0;
if (dockWidget->property("managed_dockwidget").isNull()) { // for the debugger tool bar
QWidget *titleBarWidget = dockWidget->titleBarWidget();
if (d->m_locked && !titleBarWidget && !dockWidget->isFloating())
titleBarWidget = new QWidget(dockWidget);
else if ((!d->m_locked || dockWidget->isFloating()) && titleBarWidget) {
delete titleBarWidget;
titleBarWidget = 0;
}
dockWidget->setTitleBarWidget(titleBarWidget);
}
dockWidget->setTitleBarWidget(titleBarWidget);
dockWidget->setFeatures(features);
}
......@@ -257,7 +259,15 @@ bool FancyMainWindow::isLocked() const
QMenu *FancyMainWindow::createPopupMenu()
{
QMenu *menu = QMainWindow::createPopupMenu();
QMenu *menu = new QMenu(this);;
QList<QDockWidget *> dockwidgets = qFindChildren<QDockWidget *>(this);
for (int i = 0; i < dockwidgets.size(); ++i) {
QDockWidget *dockWidget = dockwidgets.at(i);
if (dockWidget->property("managed_dockwidget").isNull()
&& dockWidget->parentWidget() == this) {
menu->addAction(dockwidgets.at(i)->toggleViewAction());
}
}
menu->addAction(&d->m_menuSeparator1);
menu->addAction(&d->m_toggleLockedAction);
menu->addAction(&d->m_menuSeparator2);
......
......@@ -476,6 +476,7 @@ QWidget *DebuggerMainWindow::createContents(IMode *mode)
dock->setFeatures(QDockWidget::NoDockWidgetFeatures);
dock->setAllowedAreas(Qt::BottomDockWidgetArea);
dock->setTitleBarWidget(new QWidget(dock));
dock->setProperty("managed_dockwidget", QLatin1String("true"));
addDockWidget(Qt::BottomDockWidgetArea, dock);
setToolBarDockWidget(dock);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment