Commit f323e568 authored by Marcel Campen's avatar Marcel Campen

New Draw Mode Context Menu



git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@13561 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 09a432ef
......@@ -573,9 +573,12 @@ void ViewControlPlugin::slotUpdateContextMenu( int _objectId ){
ACG::SceneGraph::DrawModes::DrawMode id = availDrawModeIds[i];
std::string descr = id.description();
QAction * action = new QAction( descr.c_str(), drawGroup );
action->setCheckable( true );
action->setChecked( activeDrawModes_.containsAtomicDrawMode(id) );
QCheckBox *checkBox = new QCheckBox(QString(descr.c_str()), viewControlMenu_);
checkBox->setChecked(activeDrawModes_.containsAtomicDrawMode(id));
QWidgetAction *checkableAction = new QWidgetAction(drawGroup);
checkableAction->setText(descr.c_str());
checkableAction->setDefaultWidget(checkBox);
connect(checkBox, SIGNAL(toggled(bool) ), checkableAction, SLOT(trigger() ) );
}
viewControlMenu_->addActions( drawGroup->actions() );
......@@ -615,7 +618,10 @@ void ViewControlPlugin::slotDrawModeSelected( QAction * _action) {
if ( qApp->keyboardModifiers() & Qt::ShiftModifier )
activeDrawModes_ = ( activeDrawModes_ ^ mode);
else
{
emit hideContextMenu();
activeDrawModes_ = mode ;
}
} else {
// Switch back to global drawmode-> default
......
......@@ -107,6 +107,7 @@ class ViewControlPlugin : public QObject, BaseInterface , PickingInterface, Logg
// ContextMenuInterface
void addContextMenuItem(QAction* _action , ContextMenuType _type);
void addContextMenuItem(QAction* _action , DataType _objectType , ContextMenuType _type );
void hideContextMenu();
void setSlotDescription(QString _slotName, QString _slotDescription,
QStringList _parameters, QStringList _descriptions);
......
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