From 42e5b2cf4f924502b5cc7dc4d4730fbef28e7a2c Mon Sep 17 00:00:00 2001 From: Vivien Delmon Date: Wed, 18 May 2011 11:56:18 +0200 Subject: [PATCH] Resolve #285 - Add a call to UpdateRenderWindows after resizing splitters in ChangeViewMode. Use relative sizes when resizing splitters. --- vv/vvMainWindow.cxx | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/vv/vvMainWindow.cxx b/vv/vvMainWindow.cxx index 303efeb..acbb7d4 100644 --- a/vv/vvMainWindow.cxx +++ b/vv/vvMainWindow.cxx @@ -1241,36 +1241,27 @@ void vvMainWindow::ShowHelpDialog() //------------------------------------------------------------------------------ void vvMainWindow::ChangeViewMode() { - QListIterator it(splitter_3->sizes()); - int max_size = 0; - while (it.hasNext()) { - max_size += it.next(); - } - QList size0; - QList size1; + QList size; if (viewMode == 1) { viewMode = 0; - size0.push_back(max_size); - size0.push_back(0); - size1.push_back(max_size + 1); - size1.push_back(0); - splitter_3->setSizes(size0); - OSplitter->setSizes(size1); + size.push_back(1); + size.push_back(0); + splitter_3->setSizes(size); + OSplitter->setSizes(size); DataTree->setColumnHidden(2,1); DataTree->setColumnHidden(3,1); DataTree->setColumnHidden(4,1); } else { viewMode = 1; - size0.push_back(max_size / 2); - size0.push_back(max_size / 2); - size1.push_back((max_size + 1) / 2); - size1.push_back((max_size + 1) / 2); - splitter_3->setSizes(size0); - OSplitter->setSizes(size1); + size.push_back(1); + size.push_back(1); + splitter_3->setSizes(size); + OSplitter->setSizes(size); DataTree->setColumnHidden(2,0); DataTree->setColumnHidden(3,0); DataTree->setColumnHidden(4,0); } + UpdateRenderWindows(); } //------------------------------------------------------------------------------ -- 2.47.1