diff --git a/Code/Common/Gui/mvdColorSetupController.cxx b/Code/Common/Gui/mvdColorSetupController.cxx index 3c09d9cf041209d1972b426ad58a586154428686..d143dbfaaf30742bbde42d99a35ff99014f591ba 100644 --- a/Code/Common/Gui/mvdColorSetupController.cxx +++ b/Code/Common/Gui/mvdColorSetupController.cxx @@ -217,6 +217,10 @@ ColorSetupController // Set current-index of white (gray). colorSetupWidget->SetCurrentGrayIndex( 0 ); + + // + // Alpha + colorSetupWidget->SetAlpha( 1.0 ); } colorSetupWidget->blockSignals( widgetSignalsBlocked ); } @@ -230,6 +234,9 @@ ColorSetupController { // Reset color-setup widget. ResetIndices( RGBW_CHANNEL_RGB ); + + // Reset alpha. + ResetAlpha(); } /*******************************************************************************/ @@ -307,6 +314,37 @@ ColorSetupController this->blockSignals( thisSignalsBlocked ); } +/*******************************************************************************/ +void +ColorSetupController +::ResetAlpha() +{ + + // + // Access color-dynamics widget. + ColorSetupWidget* colorSetupWidget = GetWidget< ColorSetupWidget >(); + + // + // Access image-model. + VectorImageModel* imageModel = GetModel< VectorImageModel >(); + assert( imageModel!=NULL ); + + // Block this controller's signals to prevent display refreshes + // but let let widget(s) signal their changes so linked values + // will be correctly updated. + bool thisSignalsBlocked = this->blockSignals( true ); + { + // Block widget's signals... + //...but force call to valueChanged() slot to force refresh. + bool widgetSignalsBlocked = colorSetupWidget->blockSignals( true ); + { + colorSetupWidget->SetAlpha( imageModel->GetSettings().GetAlpha() ); + } + colorSetupWidget->blockSignals( widgetSignalsBlocked ); + } + this->blockSignals( thisSignalsBlocked ); +} + /*******************************************************************************/ /* SLOTS */ /*******************************************************************************/ diff --git a/Code/Common/Gui/mvdColorSetupController.h b/Code/Common/Gui/mvdColorSetupController.h index 73c056bb7cae62757cecd5a93799c788b3c6ee99..02519669cad5a3d0867d38ceed5c51da7d91b292 100644 --- a/Code/Common/Gui/mvdColorSetupController.h +++ b/Code/Common/Gui/mvdColorSetupController.h @@ -157,6 +157,10 @@ private: */ void ResetIndices( RgbwChannel channels ); + /** + */ + void ResetAlpha(); + // // AbstractModelController overrides.