소스 검색

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);
 }