Commit 0a3791f3 authored by Jan Möbius's avatar Jan Möbius
Browse files

Moved pickmode toolbars to the left for now to find bug with invisible toolbars in scene

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@11631 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 39a3ed09
......@@ -146,6 +146,7 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
windowMenu_(0),
AC_ShowViewModeControls_(0),
AC_ShowToolbox_(0),
pickToolbar_(0),
cursorPainter_(0),
sceneGraphDialog_(0),
fileMenu_(0),
......@@ -553,13 +554,6 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
toolSplitter_->setSizes(wsizes);
}
// ======================================================================
// Create pick ToolBar
// ======================================================================
pickToolbar_ = new QtPickToolbar (this, centerWidget_);
// ======================================================================
// Context menu setup
// ======================================================================
......@@ -1115,7 +1109,6 @@ CoreWidget::sceneRectChanged(const QRectF &rect)
{
centerWidget_->setGeometry (rect);
slidingLogger_->updateGeometry ();
pickToolbar_->updateGeometry ();
}
//-----------------------------------------------------------------------------
......
......@@ -655,7 +655,7 @@ public:
QScrollArea* toolBoxScroll_;
/// Toolbar showed in pickmode
QtPickToolbar* pickToolbar_;
QToolBar* pickToolbar_;
/// Cursor handling
CursorPainter* cursorPainter_;
......
......@@ -106,34 +106,45 @@ void CoreWidget::setActionMode(const Viewer::ActionMode _am){
cursorPainter_->setCursor(QCursor( QPixmap( OpenFlipper::Options::iconDirStr() + QDir::separator() + "cursor_whatsthis.png" ) ,0,0 ));
break;
}
// update toolbar
switch ( _am )
{
case Viewer::ExamineMode:
if ( pickToolbar_ != 0) {
pickToolbar_->hide();
removeToolBar(pickToolbar_);
pickToolbar_ = 0;
}
break;
case Viewer::LightMode:
break;
case Viewer::PickingMode:
// Show the pickMode Toolbar for this picking mode if it is set
if ((pick_mode_idx_ != -1) && pick_modes_[pick_mode_idx_].toolbar() ) {
if ( pickToolbar_ != 0) {
// Remove old toolbar
pickToolbar_->hide();
removeToolBar(pickToolbar_);
pickToolbar_ = 0;
}
//update Viewers
pickToolbar_ = pick_modes_[pick_mode_idx_].toolbar();
pickToolbar_->setOrientation(Qt::Vertical);
addToolBar(Qt::LeftToolBarArea,pickToolbar_);
pickToolbar_->show();
}
break;
case Viewer::QuestionMode:
break;
}
for ( unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i ) {
//update Viewers
for ( unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i ) {
examiner_widgets_[i]->sceneGraph( PluginFunctions::getSceneGraphRootNode() );
examiner_widgets_[i]->trackMouse(false);
switch ( _am )
{
case Viewer::ExamineMode:
pickToolbar_->detachToolbar ();
break;
case Viewer::PickingMode:
if (pick_mode_idx_ != -1) {
examiner_widgets_[i]->trackMouse(pick_modes_[pick_mode_idx_].tracking() );
// Show the pickMode Toolbar for this picking mode if it is set
if (pick_modes_[pick_mode_idx_].toolbar() )
pickToolbar_->attachToolbar (pick_modes_[pick_mode_idx_].toolbar() );
else
pickToolbar_->detachToolbar ();
}
break;
default:
break;
}
}
//emit pickmodeChanged with either the name of the current pickmode or an empty string
......@@ -252,10 +263,27 @@ void CoreWidget::pickMode( int _id )
pick_mode_idx_ = _id;
pick_mode_name_ = pick_modes_[pick_mode_idx_].name();
if (pick_modes_[pick_mode_idx_].toolbar() )
pickToolbar_->attachToolbar (pick_modes_[pick_mode_idx_].toolbar() );
else
pickToolbar_->detachToolbar ();
if (pick_modes_[pick_mode_idx_].toolbar() ) {
if ( pickToolbar_ != 0) {
// Remove old toolbar
pickToolbar_->hide();
removeToolBar(pickToolbar_);
pickToolbar_ = 0;
}
pickToolbar_ = pick_modes_[pick_mode_idx_].toolbar();
pickToolbar_->setOrientation(Qt::Vertical);
addToolBar(Qt::LeftToolBarArea,pickToolbar_);
pickToolbar_->show();
} else
if ( pickToolbar_ != 0) {
// Remove old toolbar
pickToolbar_->hide();
removeToolBar(pickToolbar_);
pickToolbar_ = 0;
}
// adjust mouse tracking
if ( pickingMode() )
......@@ -338,8 +366,20 @@ void CoreWidget::setPickModeToolbar( const std::string _mode , QToolBar * _toolb
pick_modes_[i].toolbar( _toolbar );
// Activate the toolbar if this mode is currently active
if (pick_mode_name_ == _mode && pickingMode() )
pickToolbar_->attachToolbar (_toolbar);
if (pick_mode_name_ == _mode && pickingMode() ) {
if ( pickToolbar_ != 0) {
// Remove old toolbar
pickToolbar_->hide();
removeToolBar(pickToolbar_);
pickToolbar_ = 0;
}
pickToolbar_ = _toolbar;
pickToolbar_->setOrientation(Qt::Vertical);
addToolBar(Qt::LeftToolBarArea,pickToolbar_);
pickToolbar_->show();
}
break;
}
......@@ -355,7 +395,12 @@ void CoreWidget::removePickModeToolbar( const std::string _mode )
pick_modes_[i].toolbar(0);
if (pick_mode_name_ == _mode && pickingMode() )
pickToolbar_->detachToolbar ();
if ( pickToolbar_ != 0) {
// Remove old toolbar
pickToolbar_->hide();
removeToolBar(pickToolbar_);
pickToolbar_ = 0;
}
break;
}
}
......
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