Skip to content
Snippets Groups Projects
Commit 1103a4a3 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Show gepetto logo when no dock widget is visible.

parent 6273de78
No related branches found
No related tags found
No related merge requests found
......@@ -219,6 +219,7 @@ signals:
void openLoadRobotDialog ();
void openLoadEnvironmentDialog ();
void activateCollision(bool activate);
void dockVisibilityChanged(bool visible);
void handleWorkerDone (int id);
......
......@@ -28,6 +28,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="contextMenuPolicy">
<enum>Qt::NoContextMenu</enum>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
......
......@@ -115,11 +115,13 @@ namespace gepetto {
dock->adjustSize();
ui_->menuWindow->addAction(dock->toggleViewAction ());
actionSearchBar_->addAction(dock->toggleViewAction ());
connect(dock,SIGNAL(visibilityChanged(bool)),SLOT(dockVisibilityChanged(bool)));
}
void MainWindow::removeDockWidget(QDockWidget *dock)
{
ui_->menuWindow->removeAction(dock->toggleViewAction());
disconnect(dock);
QMainWindow::removeDockWidget(dock);
}
......@@ -249,7 +251,6 @@ namespace gepetto {
if (osgWindows_.empty()) {
// This OSGWidget should be the central view
centralWidget_ = osgWidget;
setCentralWidget(0);
#if GEPETTO_GUI_HAS_PYTHONQT
pythonWidget_->addToContext("osg", centralWidget_);
#endif
......@@ -391,6 +392,21 @@ namespace gepetto {
}
}
void MainWindow::dockVisibilityChanged(bool visible)
{
QWidget* cw = QMainWindow::centralWidget();
if (visible && cw->isVisible())
cw->hide();
else {
const QObjectList& objs = children();
foreach(const QObject* obj, objs) {
const QDockWidget* dock = qobject_cast<const QDockWidget*>(obj);
if (dock != 0 && dock->isVisible()) return;
}
cw->show();
}
}
void MainWindow::setupInterface()
{
// Menu "Window"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment