Commit 56df9c37 authored by Matthias Möller's avatar Matthias Möller
Browse files

toolbar buttons keeps checked, if pressed twice

refs #1378

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@16084 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 0ca720b7
...@@ -414,6 +414,7 @@ CoreWidget( QVector<ViewMode*>& _viewModes, ...@@ -414,6 +414,7 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
moveButton_->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"transform-move.png") ); moveButton_->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"transform-move.png") );
moveButton_->setMinimumSize( 16, 16 ); moveButton_->setMinimumSize( 16, 16 );
moveButton_->setMaximumSize( 32, 32 ); moveButton_->setMaximumSize( 32, 32 );
moveButton_->setCheckable(true);
moveButton_->setToolTip( tr("Switch to <b>move</b> mode.") ); moveButton_->setToolTip( tr("Switch to <b>move</b> mode.") );
moveButton_->setWhatsThis(tr( moveButton_->setWhatsThis(tr(
"Switch to <b>move</b> mode.<br>" "Switch to <b>move</b> mode.<br>"
...@@ -427,13 +428,14 @@ CoreWidget( QVector<ViewMode*>& _viewModes, ...@@ -427,13 +428,14 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
this, SLOT( slotActionModeChanged(Viewer::ActionMode) ) );*/ this, SLOT( slotActionModeChanged(Viewer::ActionMode) ) );*/
viewerToolbar_->addWidget( moveButton_ )->setText(tr("Move")); viewerToolbar_->addWidget( moveButton_ )->setText(tr("Move"));
moveButton_->setDown(true); moveButton_->setChecked(true);
pickButton_ = new QToolButton( viewerToolbar_ ); pickButton_ = new QToolButton( viewerToolbar_ );
pickButton_->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"pick.png") ); pickButton_->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"pick.png") );
pickButton_->setMinimumSize( 16, 16 ); pickButton_->setMinimumSize( 16, 16 );
pickButton_->setMaximumSize( 32, 32 ); pickButton_->setMaximumSize( 32, 32 );
pickButton_->setCheckable(true);
pickButton_->setToolTip(tr("Switch to <b>picking</b> mode.")); pickButton_->setToolTip(tr("Switch to <b>picking</b> mode."));
pickButton_->setWhatsThis(tr( pickButton_->setWhatsThis(tr(
"Switch to <b>picking</b> mode.<br>" "Switch to <b>picking</b> mode.<br>"
...@@ -448,6 +450,7 @@ CoreWidget( QVector<ViewMode*>& _viewModes, ...@@ -448,6 +450,7 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
questionButton_->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"help-about.png") ); questionButton_->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"help-about.png") );
questionButton_->setMinimumSize( 16, 16 ); questionButton_->setMinimumSize( 16, 16 );
questionButton_->setMaximumSize( 32, 32 ); questionButton_->setMaximumSize( 32, 32 );
questionButton_->setCheckable(true);
questionButton_->setToolTip(tr("Switch to <b>identification</b> mode.")); questionButton_->setToolTip(tr("Switch to <b>identification</b> mode."));
questionButton_->setWhatsThis(tr( questionButton_->setWhatsThis(tr(
"Switch to <b>identification</b> mode.<br>" "Switch to <b>identification</b> mode.<br>"
......
...@@ -62,32 +62,31 @@ ...@@ -62,32 +62,31 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void CoreWidget::setActionMode(const Viewer::ActionMode _am){ void CoreWidget::setActionMode(const Viewer::ActionMode _am){
if (_am != actionMode_) {
lastActionMode_ = actionMode_;
actionMode_ = _am;
// update Buttons // update Buttons
moveButton_->setChecked(false);
moveButton_->setDown(false); pickButton_->setChecked(false);
pickButton_->setDown(false); questionButton_->setChecked(false);
questionButton_->setDown(false);
switch (_am) switch (_am)
{ {
case Viewer::ExamineMode: case Viewer::ExamineMode:
moveButton_->setDown(true); moveButton_->setChecked(true);
break; break;
case Viewer::LightMode: case Viewer::LightMode:
break; break;
case Viewer::PickingMode: case Viewer::PickingMode:
pickButton_->setDown(true); pickButton_->setChecked(true);
break; break;
case Viewer::QuestionMode: case Viewer::QuestionMode:
questionButton_->setDown(true); questionButton_->setChecked(true);
break; break;
} }
if (_am != actionMode_) {
lastActionMode_ = actionMode_;
actionMode_ = _am;
// update cursor // update cursor
switch ( _am ) switch ( _am )
{ {
......
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