Fix for the bug IPAL21796: popup and dialog box name forTransparency consistence

This commit is contained in:
ana 2010-12-10 07:51:27 +00:00
parent 345ba03634
commit 3da46a70ac

View File

@ -96,8 +96,8 @@ GEOMToolsGUI_TransparencyDlg::GEOMToolsGUI_TransparencyDlg( QWidget* parent )
GroupC1Layout->setMargin( 11 ); GroupC1Layout->setMargin( 11 );
QLabel* TextLabelTransparent = new QLabel( tr( "GEOM_TRANSPARENCY_TRANSPARENT" ), GroupC1 ); QLabel* TextLabelTransparent = new QLabel( tr( "GEOM_TRANSPARENCY_TRANSPARENT" ), GroupC1 );
TextLabelTransparent->setAlignment( Qt::AlignRight ); TextLabelTransparent->setAlignment( Qt::AlignLeft );
GroupC1Layout->addWidget( TextLabelTransparent, 0, 0 ); GroupC1Layout->addWidget( TextLabelTransparent, 0, 2 );
myValueLab = new QLabel( GroupC1 ); myValueLab = new QLabel( GroupC1 );
myValueLab->setAlignment( Qt::AlignCenter ); myValueLab->setAlignment( Qt::AlignCenter );
@ -106,8 +106,8 @@ GEOMToolsGUI_TransparencyDlg::GEOMToolsGUI_TransparencyDlg( QWidget* parent )
GroupC1Layout->addWidget( myValueLab, 0, 1 ); GroupC1Layout->addWidget( myValueLab, 0, 1 );
QLabel* TextLabelOpaque = new QLabel( tr( "GEOM_TRANSPARENCY_OPAQUE" ), GroupC1 ); QLabel* TextLabelOpaque = new QLabel( tr( "GEOM_TRANSPARENCY_OPAQUE" ), GroupC1 );
TextLabelOpaque->setAlignment( Qt::AlignLeft ); TextLabelOpaque->setAlignment( Qt::AlignRight );
GroupC1Layout->addWidget( TextLabelOpaque, 0, 2 ); GroupC1Layout->addWidget( TextLabelOpaque, 0, 0 );
//GroupC1Layout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 ); //GroupC1Layout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 );
mySlider = new QSlider( Qt::Horizontal, GroupC1 ); mySlider = new QSlider( Qt::Horizontal, GroupC1 );
@ -231,7 +231,7 @@ void GEOMToolsGUI_TransparencyDlg::ValueHasChanged()
//================================================================================= //=================================================================================
void GEOMToolsGUI_TransparencyDlg::SetTransparency() void GEOMToolsGUI_TransparencyDlg::SetTransparency()
{ {
float newValue = ( 100 - mySlider->value() ) / 100.; float newValue = mySlider->value() / 100.;
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
if ( !app ) if ( !app )
@ -259,7 +259,7 @@ void GEOMToolsGUI_TransparencyDlg::SetTransparency()
SVTK_View* aView = vtkVW->getView(); SVTK_View* aView = vtkVW->getView();
if ( myFirstInit ) { if ( myFirstInit ) {
myFirstInit = false; myFirstInit = false;
int transp = int (100 - ((aView->GetTransparency(FirstIOS))*100.0) + 0.5); int transp = int ((aView->GetTransparency(FirstIOS))*100.0 + 0.5);
mySlider->setValue(transp); mySlider->setValue(transp);
ValueHasChanged(); ValueHasChanged();
return; return;
@ -281,7 +281,7 @@ void GEOMToolsGUI_TransparencyDlg::SetTransparency()
aisShape = gb->ConvertIOinGEOMAISShape( FirstIOS, found ); aisShape = gb->ConvertIOinGEOMAISShape( FirstIOS, found );
if( !found ) if( !found )
return; return;
int transp = int( 100 - ( aisShape->Transparency() * 100.0 ) + 0.5); int transp = int( aisShape->Transparency() * 100.0 + 0.5);
mySlider->setValue(transp); mySlider->setValue(transp);
ValueHasChanged(); ValueHasChanged();
return; return;