Changeset 80415 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Aug 25, 2019 2:44:53 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 132889
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationRuntime.cpp
r80414 r80415 62 62 63 63 64 65 64 /********************************************************************************************************************************* 66 65 * UIRuntimeInfoWidget definition. * … … 77 76 protected: 78 77 79 void retranslateUi() /* override */; 78 virtual void retranslateUi() /* override */; 79 virtual QSize sizeHint() const; 80 virtual QSize minimumSizeHint() const /* override */; 81 80 82 81 83 private: … … 83 85 void runTimeAttributes(); 84 86 void insertInfoLine(InfoLine enmInfoLine, const QString& strLabel, const QString &strInfo); 87 void computeMinimumWidth(); 85 88 86 89 CMachine m_machine; … … 104 107 105 108 int m_iFontHeight; 109 /** Computed by computing the maximum length line. Used to avoid having horizontal scroll bars. */ 110 int m_iMinimumWidth; 106 111 }; 107 112 … … 174 179 , m_machine(machine) 175 180 , m_console(console) 181 , m_iMinimumWidth(0) 176 182 177 183 { … … 180 186 // setAutoFillBackground(true); 181 187 // setPalette(pal); 188 189 setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); 182 190 183 191 m_iFontHeight = QFontMetrics(font()).height(); … … 201 209 202 210 runTimeAttributes(); 211 computeMinimumWidth(); 203 212 } 204 213 … … 217 226 m_strGuestOSTypeLabel = QApplication::translate("UIVMInformationDialog", "Guest OS Type"); 218 227 m_strRemoteDesktopLabel = QApplication::translate("UIVMInformationDialog", "Remote Desktop Server Port"); 228 } 229 230 QSize UIRuntimeInfoWidget::sizeHint() const 231 { 232 return QSize(m_iMinimumWidth, m_iMinimumWidth); 233 } 234 235 QSize UIRuntimeInfoWidget::minimumSizeHint() const 236 { 237 printf("mini %d\n", m_iMinimumWidth); 238 return QSize(m_iMinimumWidth, m_iMinimumWidth); 219 239 } 220 240 … … 367 387 } 368 388 389 void UIRuntimeInfoWidget::computeMinimumWidth() 390 { 391 m_iMinimumWidth = 0; 392 for (int j = 0; j < columnCount(); ++j) 393 m_iMinimumWidth += columnWidth(j); 394 } 395 396 369 397 /********************************************************************************************************************************* 370 398 * UIChart implementation. * … … 551 579 QFont font = painter.font(); 552 580 font.setBold(true); 581 /** @todo: make this size dynamic. aka. autoscale the font. */ 553 582 font.setPixelSize(16); 554 583 painter.setFont(font);
Note:
See TracChangeset
for help on using the changeset viewer.