]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
no message
authorstv <stv@opencascade.com>
Fri, 3 Jun 2005 04:35:08 +0000 (04:35 +0000)
committerstv <stv@opencascade.com>
Fri, 3 Jun 2005 04:35:08 +0000 (04:35 +0000)
src/Qtx/QtxWorkstack.cxx
src/Qtx/QtxWorkstack.h

index fd3955e4787c4e59b76c40a22017f2d1a14645fd..8fd98059c62a79fd554dc04eb9c82705478f0dde 100644 (file)
@@ -99,10 +99,25 @@ void QtxWorkstack::split( const int o )
   area->removeWidget( curWid );
   newArea->insertWidget( curWid );
 
+  distributeSpace( trg );
+
   curWid->show();
   curWid->setFocus();
 }
 
+void QtxWorkstack::distributeSpace( QSplitter* split ) const
+{
+  if ( !split )
+    return;
+
+  QIntList szList = split->sizes();
+  int size = ( split->orientation() == Horizontal ?
+               split->width() : split->height() ) / szList.count();
+  for ( QIntList::iterator it = szList.begin(); it != szList.end(); ++it )
+    *it = size;
+  split->setSizes( szList );
+}
+
 void QtxWorkstack::splitVertical()
 {
   split( Qt::Vertical );
index 804d3c201e7cd2193c07f0aecc278a0293091663..fa9c4584afc320aba4672b6e8e6acca0edf1107b 100644 (file)
@@ -79,6 +79,8 @@ private:
   void                updateState();
   void                updateState( QSplitter* );
 
+  void                distributeSpace( QSplitter* ) const;
+
 private:
   QWidget*            myWin;
   QtxWorkstackArea*   myArea;