Salome HOME
Modify default icon for the module
[modules/gui.git] / src / Qtx / QtxToolBar.cxx
index 311f1deb37c9cbfa932bdd55135b7f5bf93032cf..ae46ca5b87d603fff0c2d3b8207db40e16f79d3f 100644 (file)
@@ -76,7 +76,7 @@ bool QtxToolBar::Watcher::eventFilter( QObject* o, QEvent* e )
 
   bool updVis = ( o != myCont && ( e->type() == QEvent::Show || e->type() == QEvent::ShowToParent ||
                                    e->type() == QEvent::Hide || e->type() == QEvent::HideToParent ) ) ||
-                ( o == myCont && e->type() == QEvent::ChildRemoved );
+                ( o == myCont && ( e->type() == QEvent::ChildRemoved || e->type() == QEvent::Show || e->type() == QEvent::ShowToParent ) );
 
   if ( updVis )
   {
@@ -180,10 +180,10 @@ void QtxToolBar::Watcher::updateVisibility()
   }
 
   QMainWindow* mw = myCont->mainWindow();
-  if ( mw && myEmpty != vis )
+  if ( mw && myEmpty == vis )
   {
-    myEmpty = vis;
-    if ( myEmpty )
+    myEmpty = !vis;
+    if ( !myEmpty )
       mw->setAppropriate( myCont, myState );
     else
     {
@@ -192,7 +192,7 @@ void QtxToolBar::Watcher::updateVisibility()
     }
   }
 
-  vis = myEmpty && myVisible;
+  vis = !myEmpty && myVisible;
   if ( vis != myCont->isVisibleTo( myCont->parentWidget() ) )
     vis ? showContainer() : hideContainer();
 }