- Timestamp:
- Jul 13, 2020 10:10:35 AM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/monitor/resource
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/monitor/resource/UIResourceMonitor.cpp
r83685 r85303 1199 1199 , m_pHostStatsWidget(0) 1200 1200 , m_fIsCurrentTool(true) 1201 , m_iSortIndicatorWidth(0) 1201 1202 { 1202 1203 prepare(); … … 1268 1269 void UIResourceMonitorWidget::prepare() 1269 1270 { 1271 /* Try to guest the sort indicator's width: */ 1272 int iIndicatorMargin = 3; 1273 QIcon sortIndicator = qApp->QApplication::style()->standardIcon(QStyle::SP_TitleBarUnshadeButton); 1274 QList<QSize> iconSizes = sortIndicator.availableSizes(); 1275 foreach(const QSize &msize, iconSizes) 1276 m_iSortIndicatorWidth = qMax(m_iSortIndicatorWidth, msize.width()); 1277 if (m_iSortIndicatorWidth == 0) 1278 m_iSortIndicatorWidth = 20; 1279 m_iSortIndicatorWidth += 2 * iIndicatorMargin; 1280 1270 1281 loadHiddenColumnList(); 1271 1282 prepareWidgets(); … … 1446 1457 QFontMetrics fontMetrics(m_pTableView->font()); 1447 1458 const QMap<int, int> &columnDataStringLengths = m_pModel->dataLengths(); 1448 1449 1459 QMap<int, int> columnWidthsInPixels; 1450 1460 for (int i = 0; i < (int)VMResourceMonitorColumn_Max; ++i) … … 1455 1465 columnWidthsInPixels[i] = iMax * fontMetrics.width('x') + 1456 1466 QApplication::style()->pixelMetric(QStyle::PM_LayoutLeftMargin) + 1457 QApplication::style()->pixelMetric(QStyle::PM_LayoutRightMargin); 1467 QApplication::style()->pixelMetric(QStyle::PM_LayoutRightMargin) + 1468 m_iSortIndicatorWidth; 1458 1469 } 1459 1470 m_pTableView->setMinimumColumnWidths(columnWidthsInPixels); -
trunk/src/VBox/Frontends/VirtualBox/src/monitor/resource/UIResourceMonitor.h
r83685 r85303 122 122 /** Indicates if this widget's host tool is current tool. */ 123 123 bool m_fIsCurrentTool; 124 int m_iSortIndicatorWidth; 124 125 }; 125 126
Note:
See TracChangeset
for help on using the changeset viewer.