Changeset 55924 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- May 19, 2015 9:40:09 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/VBoxSettingsSelector.cpp
r52730 r55924 191 191 sizePolicy.setVerticalStretch (0); 192 192 sizePolicy.setHeightForWidth (mTwSelector->sizePolicy().hasHeightForWidth()); 193 const QStyle *pStyle = QApplication::style(); 194 const int iIconMetric = pStyle->pixelMetric(QStyle::PM_SmallIconSize); 193 195 mTwSelector->setSizePolicy (sizePolicy); 194 196 mTwSelector->setVerticalScrollBarPolicy (Qt::ScrollBarAlwaysOff); … … 196 198 mTwSelector->setRootIsDecorated (false); 197 199 mTwSelector->setUniformRowHeights (true); 198 mTwSelector->setIconSize(QSize( 24, 24));200 mTwSelector->setIconSize(QSize(1.5 * iIconMetric, 1.5 * iIconMetric)); 199 201 /* Add the columns */ 200 202 mTwSelector->headerItem()->setText (treeWidget_Category, "Category"); … … 291 293 { 292 294 /* Get recommended size hint: */ 295 const QStyle *pStyle = QApplication::style(); 296 const int iIconMetric = pStyle->pixelMetric(QStyle::PM_SmallIconSize); 293 297 int iItemWidth = static_cast<QAbstractItemView*>(mTwSelector)->sizeHintForColumn(treeWidget_Category); 294 int iItemHeight = qMax(24 /* icon height */, mTwSelector->fontMetrics().height() /* text height */); 298 int iItemHeight = qMax((int)(iIconMetric * 1.5) /* icon height */, 299 mTwSelector->fontMetrics().height() /* text height */); 295 300 /* Add some margin to every item in the tree: */ 296 301 iItemHeight += 4 /* margin itself */ * 2 /* margin count */; … … 298 303 mTwSelector->setSizeHintForItems(QSize(iItemWidth , iItemHeight)); 299 304 300 /* Fix selector width to minimum possible: */305 /* Adjust selector width/height: */ 301 306 mTwSelector->setFixedWidth(iItemWidth + 2 * mTwSelector->frameWidth()); 307 mTwSelector->setMinimumHeight(mTwSelector->topLevelItemCount() * iItemHeight + 308 1 /* margin itself */ * 2 /* margin count */); 302 309 303 310 /* Sort selector by the id column: */
Note:
See TracChangeset
for help on using the changeset viewer.