Add a fullscreen-ish mode that hides all dockwidgets.

Move spacer in selection widget.
This commit is contained in:
Maxime Gimeno 2018-08-23 09:42:14 +02:00
parent 949f93ab80
commit 5489d35c96
4 changed files with 48 additions and 13 deletions

View File

@ -161,6 +161,9 @@ MainWindow::MainWindow(bool verbose, QWidget* parent)
shortcut = new QShortcut(QKeySequence(Qt::Key_F5), this);
connect(shortcut, SIGNAL(activated()),
this, SLOT(reloadItem()));
shortcut = new QShortcut(QKeySequence(Qt::Key_F11), this);
connect(shortcut, SIGNAL(activated()),
this, SLOT(toggleFullScreen()));
}
proxyModel = new QSortFilterProxyModel(this);
@ -2347,3 +2350,27 @@ void MainWindow::setTransparencyPasses(int val)
viewer->setTotalPass(val);
viewer->update();
}
void MainWindow::toggleFullScreen()
{
QList<QDockWidget *> dockWidgets = findChildren<QDockWidget *>();
if(visibleDockWidgets.isEmpty())
{
Q_FOREACH(QDockWidget * dock, dockWidgets)
{
if(dock->isVisible())
{
visibleDockWidgets.append(dock);
dock->hide();
}
}
}
else
{
Q_FOREACH(QDockWidget * dock, visibleDockWidgets){
dock->show();
}
visibleDockWidgets.clear();
}
}

View File

@ -428,6 +428,10 @@ public:
void evaluate_script_quiet(QString script,
const QString & fileName = QString());
#endif
public Q_SLOTS:
void toggleFullScreen();
private:
QList<QDockWidget *> visibleDockWidgets;
};
#endif // ifndef MAINWINDOW_H

View File

@ -15,6 +15,19 @@
</property>
<widget class="QWidget" name="dockWidgetContents">
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
@ -42,19 +55,6 @@
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QTabWidget" name="selectionOrEuler">
<property name="currentIndex">

View File

@ -142,6 +142,10 @@ Viewer::Viewer(QWidget* parent, bool antialiasing)
setMouseBindingDescription(Qt::Key_O, Qt::NoModifier, Qt::LeftButton,
tr("Move the camera orthogonally to the picked facet of a Scene_surface_mesh_item or "
"to the current selection of a Scene_points_with_normal_item."));
setKeyDescription(Qt::Key_F5,
tr("Reloads the selected item if possible."));
setKeyDescription(Qt::Key_F11,
tr("Toggle the viewer's fullscreen mode."));
prev_radius = sceneRadius();
d->has_text = false;