From 0d2e89bd7f69627be141b8b4a2605d33d8baf647 Mon Sep 17 00:00:00 2001 From: stv Date: Fri, 3 Jun 2005 04:35:08 +0000 Subject: [PATCH] no message --- src/Qtx/QtxWorkstack.cxx | 15 +++++++++++++++ src/Qtx/QtxWorkstack.h | 2 ++ 2 files changed, 17 insertions(+) diff --git a/src/Qtx/QtxWorkstack.cxx b/src/Qtx/QtxWorkstack.cxx index fd3955e47..8fd98059c 100644 --- a/src/Qtx/QtxWorkstack.cxx +++ b/src/Qtx/QtxWorkstack.cxx @@ -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 ); diff --git a/src/Qtx/QtxWorkstack.h b/src/Qtx/QtxWorkstack.h index 804d3c201..fa9c4584a 100644 --- a/src/Qtx/QtxWorkstack.h +++ b/src/Qtx/QtxWorkstack.h @@ -79,6 +79,8 @@ private: void updateState(); void updateState( QSplitter* ); + void distributeSpace( QSplitter* ) const; + private: QWidget* myWin; QtxWorkstackArea* myArea; -- 2.39.2