]> SALOME platform Git repositories - modules/visu.git/blobdiff - src/VISUGUI/VisuGUI_TransparencyDlg.cxx
Salome HOME
Merge from BR_WIN_INDUS_514 branch 21/03/2011 (Windows industrialization)
[modules/visu.git] / src / VISUGUI / VisuGUI_TransparencyDlg.cxx
index f14baab8ba105d6a46439d95cf88d3794219d2dd..6ea3a861ede334e754154ca8a51caad3ab1828a5 100644 (file)
@@ -92,8 +92,8 @@ VisuGUI_TransparencyDlg::VisuGUI_TransparencyDlg( VisuGUI* theModule,
   GroupC1Layout->setMargin(11);
 
   TextLabelTransparent = new QLabel(tr("TRANSPARENCY_TRANSPARENT" ), GroupC1);
-  TextLabelTransparent->setAlignment(Qt::AlignLeft);
-  GroupC1Layout->addWidget(TextLabelTransparent, 0, 0);
+  TextLabelTransparent->setAlignment(Qt::AlignRight);
+  GroupC1Layout->addWidget(TextLabelTransparent, 0, 2);
 
   ValueLab = new QLabel(GroupC1);
   ValueLab->setAlignment(Qt::AlignCenter);
@@ -102,8 +102,8 @@ VisuGUI_TransparencyDlg::VisuGUI_TransparencyDlg( VisuGUI* theModule,
   GroupC1Layout->addWidget(ValueLab, 0, 1);
 
   TextLabelOpaque = new QLabel(tr("TRANSPARENCY_OPAQUE" ), GroupC1);
-  TextLabelOpaque->setAlignment(Qt::AlignRight);
-  GroupC1Layout->addWidget(TextLabelOpaque, 0, 2);
+  TextLabelOpaque->setAlignment(Qt::AlignLeft);
+  GroupC1Layout->addWidget(TextLabelOpaque, 0, 1);
 
   Slider1 = new QSlider( Qt::Horizontal, GroupC1 );
   Slider1->setMinimum( 0 );
@@ -207,7 +207,7 @@ void VisuGUI_TransparencyDlg::SetTransparency()
 {
   if( myViewWindow ) {
     SUIT_OverrideCursor wc;
-    float opacity = this->Slider1->value() / 100.;
+    float opacity = (100 - this->Slider1->value() ) / 100.;
 
     SALOME_ListIO aList;
     mySelectionMgr->selectedObjects(aList);
@@ -274,7 +274,7 @@ void VisuGUI_TransparencyDlg::onSelectionChanged()
        }
       }
     }
-    Slider1->setValue( opacity == UNDEF_OPACITY ? DEFAULT_OPACITY : opacity );
+    Slider1->setValue( 100 - ( opacity == UNDEF_OPACITY ? DEFAULT_OPACITY : opacity ) );
   }
   ValueHasChanged();
 }