Commit 33e8719a authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum

[CHANGE #219] improved gl widget context menu

parent fe69e859
...@@ -356,8 +356,9 @@ void WMainWindow::setupGUI() ...@@ -356,8 +356,9 @@ void WMainWindow::setupGUI()
controlPanelTrigger->setShortcuts( controlPanelShortcut ); controlPanelTrigger->setShortcuts( controlPanelShortcut );
this->addAction( controlPanelTrigger ); // this enables the action even if the menu bar is invisible this->addAction( controlPanelTrigger ); // this enables the action even if the menu bar is invisible
resetButton->setMenu( m_mainGLWidget->getCameraPresetsMenu() ); m_cameraMenu->addAction( m_mainGLWidget->getCameraResetAction() );
m_cameraMenu->addMenu( m_mainGLWidget->getCameraPresetsMenu() ); m_cameraMenu->addMenu( m_mainGLWidget->getCameraPresetsMenu() );
resetButton->setMenu( m_mainGLWidget->getCameraPresetsMenu() );
m_helpAction = new QAction( "Help", this ); m_helpAction = new QAction( "Help", this );
m_helpMenu = m_menuBar->addMenu( "Help" ); m_helpMenu = m_menuBar->addMenu( "Help" );
......
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
#include "WQt4Gui.h" #include "WQt4Gui.h"
#include "WSettingAction.h"
#include "WQtGLDockWidget.h" #include "WQtGLDockWidget.h"
#include "WQtGLDockWidget.moc" #include "WQtGLDockWidget.moc"
...@@ -76,6 +78,9 @@ WQtGLDockWidget::WQtGLDockWidget( QString viewTitle, QString dockTitle, QWidget* ...@@ -76,6 +78,9 @@ WQtGLDockWidget::WQtGLDockWidget( QString viewTitle, QString dockTitle, QWidget*
camPresets->setMenu( getGLWidget()->getCameraPresetsMenu() ); camPresets->setMenu( getGLWidget()->getCameraPresetsMenu() );
addAction( camPresets ); addAction( camPresets );
// throwing
addAction( getGLWidget()->getThrowingSetting() );
// change background color // change background color
addAction( getGLWidget()->getBackgroundColorAction() ); addAction( getGLWidget()->getBackgroundColorAction() );
} }
......
...@@ -143,6 +143,10 @@ WQtGLWidget::WQtGLWidget( std::string nameOfViewer, QWidget* parent, WGECamera:: ...@@ -143,6 +143,10 @@ WQtGLWidget::WQtGLWidget( std::string nameOfViewer, QWidget* parent, WGECamera::
tmpAction = m_cameraPresetMenu->addAction( WQt4Gui::getIconManager()->getIcon( "coronal icon" ), "Posterior", this, SLOT( setPresetViewPosterior() ), tmpAction = m_cameraPresetMenu->addAction( WQt4Gui::getIconManager()->getIcon( "coronal icon" ), "Posterior", this, SLOT( setPresetViewPosterior() ),
QKeySequence( Qt::CTRL + Qt::SHIFT + Qt::Key_P ) ); QKeySequence( Qt::CTRL + Qt::SHIFT + Qt::Key_P ) );
tmpAction->setIconVisibleInMenu( true ); tmpAction->setIconVisibleInMenu( true );
m_cameraResetAction = new QAction( WQt4Gui::getIconManager()->getIcon( "view" ), "Reset", this );
connect( m_cameraResetAction, SIGNAL( triggered( bool ) ), this, SLOT( reset() ) );
m_cameraResetAction->setToolTip( "Reset view" );
} }
WQtGLWidget::~WQtGLWidget() WQtGLWidget::~WQtGLWidget()
...@@ -520,3 +524,8 @@ QMenu* WQtGLWidget::getCameraPresetsMenu() ...@@ -520,3 +524,8 @@ QMenu* WQtGLWidget::getCameraPresetsMenu()
{ {
return m_cameraPresetMenu; return m_cameraPresetMenu;
} }
QAction* WQtGLWidget::getCameraResetAction()
{
return m_cameraResetAction;
}
...@@ -153,6 +153,12 @@ public: ...@@ -153,6 +153,12 @@ public:
*/ */
QMenu* getCameraPresetsMenu(); QMenu* getCameraPresetsMenu();
/**
* The action to trigger a camera reset.
*
* \return the action
*/
QAction* getCameraResetAction();
signals: signals:
/** /**
...@@ -351,6 +357,11 @@ private: ...@@ -351,6 +357,11 @@ private:
*/ */
QMenu* m_cameraPresetMenu; QMenu* m_cameraPresetMenu;
/**
* Camera reset.
*/
QAction* m_cameraResetAction;
private slots: private slots:
/** /**
* Function to handle updates in the setting \ref m_allowThrowSetting. * Function to handle updates in the setting \ref m_allowThrowSetting.
......
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