Commit 33e8719a by Sebastian Eichelbaum

[CHANGE #219] improved gl widget context menu

parent fe69e859
......@@ -356,8 +356,9 @@ void WMainWindow::setupGUI()
controlPanelTrigger->setShortcuts( controlPanelShortcut );
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() );
resetButton->setMenu( m_mainGLWidget->getCameraPresetsMenu() );
m_helpAction = new QAction( "Help", this );
m_helpMenu = m_menuBar->addMenu( "Help" );
......
......@@ -28,6 +28,8 @@
#include "WQt4Gui.h"
#include "WSettingAction.h"
#include "WQtGLDockWidget.h"
#include "WQtGLDockWidget.moc"
......@@ -76,6 +78,9 @@ WQtGLDockWidget::WQtGLDockWidget( QString viewTitle, QString dockTitle, QWidget*
camPresets->setMenu( getGLWidget()->getCameraPresetsMenu() );
addAction( camPresets );
// throwing
addAction( getGLWidget()->getThrowingSetting() );
// change background color
addAction( getGLWidget()->getBackgroundColorAction() );
}
......
......@@ -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() ),
QKeySequence( Qt::CTRL + Qt::SHIFT + Qt::Key_P ) );
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()
......@@ -520,3 +524,8 @@ QMenu* WQtGLWidget::getCameraPresetsMenu()
{
return m_cameraPresetMenu;
}
QAction* WQtGLWidget::getCameraResetAction()
{
return m_cameraResetAction;
}
......@@ -153,6 +153,12 @@ public:
*/
QMenu* getCameraPresetsMenu();
/**
* The action to trigger a camera reset.
*
* \return the action
*/
QAction* getCameraResetAction();
signals:
/**
......@@ -351,6 +357,11 @@ private:
*/
QMenu* m_cameraPresetMenu;
/**
* Camera reset.
*/
QAction* m_cameraResetAction;
private slots:
/**
* 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