Commit 437eb059 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 01d58157
......@@ -414,6 +414,7 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
moveButton_->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"transform-move.png") );
moveButton_->setMinimumSize( 16, 16 );
moveButton_->setMaximumSize( 32, 32 );
moveButton_->setCheckable(true);
moveButton_->setToolTip( tr("Switch to <b>move</b> mode.") );
moveButton_->setWhatsThis(tr(
"Switch to <b>move</b> mode.<br>"
......@@ -427,13 +428,14 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
this, SLOT( slotActionModeChanged(Viewer::ActionMode) ) );*/
viewerToolbar_->addWidget( moveButton_ )->setText(tr("Move"));
moveButton_->setDown(true);
moveButton_->setChecked(true);
pickButton_ = new QToolButton( viewerToolbar_ );
pickButton_->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"pick.png") );
pickButton_->setMinimumSize( 16, 16 );
pickButton_->setMaximumSize( 32, 32 );
pickButton_->setCheckable(true);
pickButton_->setToolTip(tr("Switch to <b>picking</b> mode."));
pickButton_->setWhatsThis(tr(
"Switch to <b>picking</b> mode.<br>"
......@@ -448,6 +450,7 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
questionButton_->setIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"help-about.png") );
questionButton_->setMinimumSize( 16, 16 );
questionButton_->setMaximumSize( 32, 32 );
questionButton_->setCheckable(true);
questionButton_->setToolTip(tr("Switch to <b>identification</b> mode."));
questionButton_->setWhatsThis(tr(
"Switch to <b>identification</b> mode.<br>"
......
......@@ -62,32 +62,31 @@
//-----------------------------------------------------------------------------
void CoreWidget::setActionMode(const Viewer::ActionMode _am){
if (_am != actionMode_) {
lastActionMode_ = actionMode_;
actionMode_ = _am;
// update Buttons
moveButton_->setDown(false);
pickButton_->setDown(false);
questionButton_->setDown(false);
moveButton_->setChecked(false);
pickButton_->setChecked(false);
questionButton_->setChecked(false);
switch (_am)
{
case Viewer::ExamineMode:
moveButton_->setDown(true);
moveButton_->setChecked(true);
break;
case Viewer::LightMode:
break;
case Viewer::PickingMode:
pickButton_->setDown(true);
pickButton_->setChecked(true);
break;
case Viewer::QuestionMode:
questionButton_->setDown(true);
questionButton_->setChecked(true);
break;
}
if (_am != actionMode_) {
lastActionMode_ = actionMode_;
actionMode_ = _am;
// update cursor
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