]> Creatis software - clitk.git/commitdiff
vv: corrected tree column updates when maximizing view
authorRomulo Pinho <romulo.pinho@lyon.unicancer.fr>
Thu, 18 Oct 2012 08:07:56 +0000 (10:07 +0200)
committerRomulo Pinho <romulo.pinho@lyon.unicancer.fr>
Thu, 18 Oct 2012 08:07:56 +0000 (10:07 +0200)
vv/vvMainWindow.cxx

index 39414595b7b087a68e8134868d7c9f3a004c1b5b..7f468d073b1553385db0336c7e17742698cedde9 100644 (file)
@@ -1240,6 +1240,7 @@ void vvMainWindow::ChangeViewMode()
   typedef struct _SIZE{
     QSplitter* splitter;
     QList<int> size1, size2;
+    int cols[3];
   }SplitterSize;
   SplitterSize sizes[4];
   sizes[0].splitter = OSplitter;
@@ -1247,24 +1248,36 @@ void vvMainWindow::ChangeViewMode()
   sizes[0].size1.push_back(0);
   sizes[0].size2.push_back(1);
   sizes[0].size2.push_back(0);
+  sizes[0].cols[0] = 2;
+  sizes[0].cols[1] = 3;
+  sizes[0].cols[2] = 4;
 
   sizes[1].splitter = ESplitter;
   sizes[1].size1.push_back(0);
   sizes[1].size1.push_back(1);
   sizes[1].size2.push_back(1);
   sizes[1].size2.push_back(0);
+  sizes[1].cols[0] = 1;
+  sizes[1].cols[1] = 3;
+  sizes[1].cols[2] = 4;
 
   sizes[2].splitter = OSplitter;
   sizes[2].size1.push_back(1);
   sizes[2].size1.push_back(0);
   sizes[2].size2.push_back(0);
   sizes[2].size2.push_back(1);
+  sizes[2].cols[0] = 1;
+  sizes[2].cols[1] = 2;
+  sizes[2].cols[2] = 4;
 
   sizes[3].splitter = ESplitter;
   sizes[3].size1.push_back(0);
   sizes[3].size1.push_back(1);
   sizes[3].size2.push_back(0);
   sizes[3].size2.push_back(1);
+  sizes[3].cols[0] = 1;
+  sizes[3].cols[1] = 2;
+  sizes[3].cols[2] = 3;
   
   int slicer = mSlicerManagers[mCurrentPickedImageIndex]->GetSelectedSlicer();
   if (viewMode == 1) {
@@ -1272,9 +1285,9 @@ void vvMainWindow::ChangeViewMode()
       viewMode = 0;
       splitter_3->setSizes(sizes[slicer].size1);
       sizes[slicer].splitter->setSizes(sizes[slicer].size2);
-      DataTree->setColumnHidden(2,1);
-      DataTree->setColumnHidden(3,1);
-      DataTree->setColumnHidden(4,1);
+      DataTree->setColumnHidden(sizes[slicer].cols[0],1);
+      DataTree->setColumnHidden(sizes[slicer].cols[1],1);
+      DataTree->setColumnHidden(sizes[slicer].cols[2],1);
     }
   } else {
     QList<int> size;
@@ -1284,9 +1297,9 @@ void vvMainWindow::ChangeViewMode()
       size.push_back(1);
       splitter_3->setSizes(size);
       sizes[slicer].splitter->setSizes(size);
-      DataTree->setColumnHidden(2,0);
-      DataTree->setColumnHidden(3,0);
-      DataTree->setColumnHidden(4,0);
+      DataTree->setColumnHidden(sizes[slicer].cols[0],0);
+      DataTree->setColumnHidden(sizes[slicer].cols[1],0);
+      DataTree->setColumnHidden(sizes[slicer].cols[2],0);
     }
   }
   UpdateRenderWindows();