Commit e054be93 authored by Marcel Campen's avatar Marcel Campen

New Draw Mode Context Menu



git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@13558 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 285fb426
......@@ -81,6 +81,10 @@ void CoreWidget::slotCustomContextMenu( const QPoint& _point ) {
}
void CoreWidget::slotHideContextMenu() {
contextMenu_->hide();
}
/** \brief Update context Menu when an arbitrary node has been clicked on.
*
* This function is called when a node has been clicked on not belonging to an object.
......@@ -868,9 +872,12 @@ void CoreWidget::slotUpdateViewerDrawMenu() {
ACG::SceneGraph::DrawModes::DrawMode id = availDrawModeIds[i];
std::string descr = id.description();
QAction * action = new QAction( descr.c_str(), drawGroupViewer_ );
action->setCheckable( true );
action->setChecked( activeDrawModes.containsAtomicDrawMode(id) );
QCheckBox *checkBox = new QCheckBox(QString(descr.c_str()), viewerDrawMenu_);
checkBox->setChecked(activeDrawModes.containsAtomicDrawMode(id));
QWidgetAction *checkableAction = new QWidgetAction(drawGroupViewer_);
checkableAction->setText(descr.c_str());
checkableAction->setDefaultWidget(checkBox);
connect(checkBox, SIGNAL(toggled(bool) ), checkableAction, SLOT(trigger() ) );
}
viewerDrawMenu_->addActions( drawGroupViewer_->actions() );
......@@ -898,7 +905,10 @@ void CoreWidget::slotViewerDrawMenu(QAction * _action) {
if ( qApp->keyboardModifiers() & Qt::ShiftModifier )
PluginFunctions::viewerProperties().drawMode( PluginFunctions::viewerProperties().drawMode() ^ mode );
else
{
contextMenu_->hide();
PluginFunctions::viewerProperties().drawMode(mode );
}
}
......
......@@ -109,6 +109,11 @@
* This struct contains a ViewMode and its status information such as used widgets,toolbars or context menus
*
*/
struct ViewMode{
/// Name of the View Mode
......@@ -569,6 +574,9 @@ public:
/// Hide or show the View Mode controls
void showViewModeControls(bool _show);
/// Hide the context menu
void slotHideContextMenu();
private slots:
/// Remove viewMode
void slotRemoveViewMode(QString _name);
......
......@@ -158,7 +158,6 @@ void CoreWidget::keyReleaseEvent(QKeyEvent* _e) {
if (_e->isAutoRepeat()) return; //consider only "real" release events
std::pair< int,Qt::KeyboardModifiers > key = std::make_pair(_e->key(), _e->modifiers() );
//iterate over all assigned keys
......
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