Commit cfc5474b authored by Mike Kremer's avatar Mike Kremer
Browse files

Added view mode combo box to toolbar.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@5956 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 317177dc
...@@ -371,6 +371,30 @@ CoreWidget( QVector<ViewMode*>& _viewModes, ...@@ -371,6 +371,30 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
connect( questionButton_,SIGNAL( clicked() ), this, SLOT( setQuestionMode() ) ); connect( questionButton_,SIGNAL( clicked() ), this, SLOT( setQuestionMode() ) );
viewerToolbar_->addWidget( questionButton_)->setText("Question"); viewerToolbar_->addWidget( questionButton_)->setText("Question");
viewmodeBox_ = new QComboBox( viewerToolbar_ );
viewmodeBox_->setMinimumSize( 32, 16 );
viewmodeBox_->setMaximumSize( 64, 32 );
viewmodeBox_->setToolTip("Switch <b>view mode</b>.");
viewmodeBox_->setWhatsThis(
"Switch <b>view mode</b>.<br>"
"Select the desired view mode. "
"Possible modes are: "
"<ul> "
"<li>Single view mode</li>"
"<li>Multi view mode (grid)</li>"
"<li>Multi view mode (hsplit)</li>"
"</ul>");
viewmodeBox_->addItem(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"singleviewmode.png"), "");
viewmodeBox_->addItem(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"multiviewmode1.png"), "");
viewmodeBox_->addItem(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"multiviewmode2.png"), "");
viewmodeBox_->setIconSize(QSize(24,24));
connect( viewmodeBox_,SIGNAL( activated(int) ), this, SLOT( setViewMode(int) ) );
viewerToolbar_->addWidget( viewmodeBox_ );
viewerToolbar_->addSeparator(); viewerToolbar_->addSeparator();
if (OpenFlipper::Options::stereo()) if (OpenFlipper::Options::stereo())
...@@ -747,6 +771,47 @@ void CoreWidget::showOptionsWidget() { ...@@ -747,6 +771,47 @@ void CoreWidget::showOptionsWidget() {
} }
void CoreWidget::nextViewMode() {
if (OpenFlipper::Options::multiView()) {
emit log("Switch MultiView mode");
switch (baseLayout_->mode()) {
case QtMultiViewLayout::SingleView:
baseLayout_->setMode(QtMultiViewLayout::Grid);
break;
case QtMultiViewLayout::Grid:
baseLayout_->setMode(QtMultiViewLayout::HSplit);
break;
case QtMultiViewLayout::HSplit:
baseLayout_->setMode(QtMultiViewLayout::SingleView);
PluginFunctions::setActiveExaminer(0);
break;
}
}
}
void
CoreWidget::setViewMode(int _idx) {
if (OpenFlipper::Options::multiView()) {
emit log("Switch MultiView mode");
switch (_idx) {
case 0:
baseLayout_->setMode(QtMultiViewLayout::SingleView);
PluginFunctions::setActiveExaminer(0);
break;
case 1:
baseLayout_->setMode(QtMultiViewLayout::Grid);
break;
case 2:
baseLayout_->setMode(QtMultiViewLayout::HSplit);
break;
}
}
}
void void
CoreWidget::slotShowSceneGraphDialog() CoreWidget::slotShowSceneGraphDialog()
......
...@@ -493,6 +493,8 @@ public: ...@@ -493,6 +493,8 @@ public:
QToolButton* pickButton_; QToolButton* pickButton_;
QToolButton* questionButton_; QToolButton* questionButton_;
QComboBox* viewmodeBox_;
/** @} */ /** @} */
//=========================================================================== //===========================================================================
...@@ -505,6 +507,12 @@ public: ...@@ -505,6 +507,12 @@ public:
void slotUpdateGlobalDrawMenu(); void slotUpdateGlobalDrawMenu();
private slots: private slots:
/// Switches over to the next view mode
void nextViewMode();
/// Change view mode that was selected in the combo box
void setViewMode(int _idx);
/// Called when the global drawMode is selected /// Called when the global drawMode is selected
void slotGlobalDrawMenu(QAction * _action); void slotGlobalDrawMenu(QAction * _action);
......
...@@ -527,23 +527,7 @@ void CoreWidget::coreKeyPressEvent (QKeyEvent* _e){ ...@@ -527,23 +527,7 @@ void CoreWidget::coreKeyPressEvent (QKeyEvent* _e){
break; break;
case Qt::Key_Space: case Qt::Key_Space:
if ( OpenFlipper::Options::multiView() ) { nextViewMode();
emit log( "Switch MultiView mode");
switch (baseLayout_->mode())
{
case QtMultiViewLayout::SingleView:
baseLayout_->setMode (QtMultiViewLayout::Grid);
break;
case QtMultiViewLayout::Grid:
baseLayout_->setMode (QtMultiViewLayout::HSplit);
break;
case QtMultiViewLayout::HSplit:
baseLayout_->setMode (QtMultiViewLayout::SingleView);
PluginFunctions::setActiveExaminer (0);
break;
}
}
break; break;
case Qt::Key_Shift : case Qt::Key_Shift :
......
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