浏览代码

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 年之前
父节点
当前提交
ed5b8be4fa
共有 1 个文件被更改,包括 2 次插入4 次删除
  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);
 }