Browse Source

Improved behaviour of dynamic layout: between 800 and 1024px window size use
vertical layout. If the window is bigger than 1024 switch to horizontal layout

Andreas Fetzer 11 years ago
parent
commit
ed5b8be4fa
1 changed files with 2 additions and 4 deletions
  1. 2 4
      Libs/DICOM/Widgets/ctkDICOMTableManager.cpp

+ 2 - 4
Libs/DICOM/Widgets/ctkDICOMTableManager.cpp

@@ -252,8 +252,6 @@ void ctkDICOMTableManager::resizeEvent(QResizeEvent *e)
   if (!d->m_DynamicLayout)
     return;
 
-  if (e->size().width() == this->minimumWidth())
-    this->setTableOrientation(Qt::Vertical);
-  else
-    this->setTableOrientation(Qt::Horizontal);
+  //Minimum size = 800 * 1.28 = 1024 => use horizontal layout (otherwise table size would be too small)
+  this->setTableOrientation(e->size().width() > 1.28*this->minimumWidth() ? Qt::Horizontal : Qt::Vertical);
 }