Explorar el Código

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 hace 11 años
padre
commit
ed5b8be4fa
Se han modificado 1 ficheros con 2 adiciones y 4 borrados
  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);
 }