Add fullscreen button/shortcut to 3d window

This commit is contained in:
Jon Jenssen 2023-04-26 16:30:15 +02:00 committed by jonjenssen
parent 0907f57de9
commit c86ce05f9a
6 changed files with 35 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@ -275,6 +275,7 @@
<file>DataVectorCalculated.svg</file>
<file>open-text-editor.svg</file>
<file>Seismic16x16.png</file>
<file>Fullscreen.png</file>
</qresource>
<qresource prefix="/Shader">
<file>fs_CellFace.glsl</file>

View File

@ -351,6 +351,11 @@ void RiuMainWindow::createActions()
connect( m_executePaintEventPerformanceTest, SIGNAL( triggered() ), SLOT( slotExecutePaintEventPerformanceTest() ) );
// View actions
m_viewFullScreen = new QAction( QIcon( ":/Fullscreen.png" ), "Full Screen", this );
m_viewFullScreen->setToolTip( "Full Screen (Ctrl+Alt+F)" );
m_viewFullScreen->setCheckable( true );
caf::CmdFeature::applyShortcutWithHintToAction( m_viewFullScreen, QKeySequence( tr( "Ctrl+Alt+F" ) ) );
m_viewFromNorth = new QAction( QIcon( ":/SouthView.svg" ), "Look South", this );
m_viewFromNorth->setToolTip( "Look South (Ctrl+Alt+S)" );
caf::CmdFeature::applyShortcutWithHintToAction( m_viewFromNorth, QKeySequence( tr( "Ctrl+Alt+S" ) ) );
@ -381,6 +386,7 @@ void RiuMainWindow::createActions()
connect( m_viewFromWest, SIGNAL( triggered() ), SLOT( slotViewFromWest() ) );
connect( m_viewFromAbove, SIGNAL( triggered() ), SLOT( slotViewFromAbove() ) );
connect( m_viewFromBelow, SIGNAL( triggered() ), SLOT( slotViewFromBelow() ) );
connect( m_viewFullScreen, SIGNAL( toggled( bool ) ), SLOT( slotViewFullScreen( bool ) ) );
// Debug actions
m_newPropertyView = new QAction( "New Project and Property View", this );
@ -484,6 +490,8 @@ void RiuMainWindow::createMenus()
// View menu
QMenu* viewMenu = RiuMenuBarBuildTools::createDefaultViewMenu( menuBar() );
viewMenu->addSeparator();
viewMenu->addAction( m_viewFullScreen );
viewMenu->addSeparator();
viewMenu->addAction( m_viewFromSouth );
viewMenu->addAction( m_viewFromNorth );
viewMenu->addAction( m_viewFromWest );
@ -595,6 +603,7 @@ void RiuMainWindow::createToolBars()
toolbar->setObjectName( toolbar->windowTitle() );
toolbar->addAction( cmdFeatureMgr->action( "RicTogglePerspectiveViewFeature" ) );
toolbar->addAction( cmdFeatureMgr->action( "RicViewZoomAllFeature" ) );
toolbar->addAction( m_viewFullScreen );
toolbar->addAction( m_viewFromNorth );
toolbar->addAction( m_viewFromSouth );
toolbar->addAction( m_viewFromEast );
@ -1227,6 +1236,22 @@ void RiuMainWindow::slotViewFromNorth()
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuMainWindow::slotViewFullScreen( bool showFullScreen )
{
if ( showFullScreen )
{
m_lastDockState = dockManager()->saveState( DOCKSTATE_VERSION );
dockManager()->restoreState( RiuDockWidgetTools::hideAllDocking3DState(), DOCKSTATE_VERSION );
}
else
{
dockManager()->restoreState( m_lastDockState, DOCKSTATE_VERSION );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -167,6 +167,7 @@ private:
QAction* m_viewFromWest;
QAction* m_viewFromAbove;
QAction* m_viewFromBelow;
QAction* m_viewFullScreen;
// Mock actions
QAction* m_mockModelAction;
@ -216,6 +217,7 @@ private slots:
// View slots
void slotRefreshViewActions();
void slotViewFullScreen( bool );
void slotViewFromNorth();
void slotViewFromSouth();
void slotViewFromEast();

View File

@ -52,8 +52,6 @@
#include <QUndoStack>
#include <QUndoView>
#define DOCKSTATE_VERSION 3
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -184,6 +182,8 @@ void RiuMainWindowBase::loadWinGeoAndDockToolBarLayout()
}
}
m_lastDockState = m_dockManager->saveState( DOCKSTATE_VERSION );
settings.beginGroup( registryFolderName() );
m_dockManager->loadPerspectives( settings );
}

View File

@ -18,6 +18,7 @@
#pragma once
#include <QByteArray>
#include <QMainWindow>
#include "cafPdmUiDragDropInterface.h"
@ -140,6 +141,10 @@ protected:
RiuMdiArea* m_mdiArea;
QMenu* m_windowMenu;
const int DOCKSTATE_VERSION = 3;
QByteArray m_lastDockState;
private:
QString registryFolderName();