diff view/PaneStack.cpp @ 101:bc5b79e7b1d8

when adding a new pane, the pane stack is divided in equals parts
author lbajardsilogic
date Thu, 12 Jul 2007 07:25:32 +0000
parents 429cfea499ad
children 033a39bff919
line wrap: on
line diff
--- a/view/PaneStack.cpp	Wed Jul 11 16:04:19 2007 +0000
+++ b/view/PaneStack.cpp	Thu Jul 12 07:25:32 2007 +0000
@@ -86,6 +86,8 @@
     frame->setLayout(layout);
     m_splitter->addWidget(frame);
 
+	resizePane();
+
     connect(pane, SIGNAL(propertyContainerAdded(PropertyContainer *)),
 	    this, SLOT(propertyContainerAdded(PropertyContainer *)));
     connect(pane, SIGNAL(propertyContainerRemoved(PropertyContainer *)),
@@ -442,4 +444,20 @@
     emit propertyStacksResized();
 }
     
+void PaneStack::resizePane()
+{
+	int totalSize = m_splitter->size().height();
+	int nbPane = getPaneCount();
 
+	if (nbPane == 0)
+		return;
+
+	QList<int> newSizes;
+
+	for (int i = 0; i< nbPane; i++)
+	{
+		newSizes.push_back(totalSize/nbPane);
+	}
+
+	m_splitter->setSizes(newSizes);
+}