Changeset 74111 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Sep 6, 2018 10:37:46 AM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager/details
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsGroup.cpp
r74110 r74111 105 105 { 106 106 /* Prepare variables: */ 107 int iMargin = data(GroupData_Margin).toInt();108 int iSpacing = data(GroupData_Spacing).toInt();109 int iMaximumWidth = (int)geometry().width() - 2 * iMargin;107 const int iMargin = data(GroupData_Margin).toInt(); 108 const int iSpacing = data(GroupData_Spacing).toInt(); 109 const int iMaximumWidth = geometry().size().toSize().width(); 110 110 int iVerticalIndent = iMargin; 111 111 … … 118 118 continue; 119 119 /* Move set: */ 120 pItem->setPos( iMargin, iVerticalIndent);120 pItem->setPos(0, iVerticalIndent); 121 121 /* Resize set: */ 122 int iWidth = iMaximumWidth; 123 pItem->resize(iWidth, pItem->minimumHeightHint()); 122 pItem->resize(iMaximumWidth, pItem->minimumHeightHint()); 124 123 /* Layout set content: */ 125 124 pItem->updateLayout(); … … 132 131 { 133 132 /* Prepare variables: */ 134 int iMargin = data(GroupData_Margin).toInt();135 133 int iMinimumWidthHint = 0; 136 134 … … 149 147 } 150 148 151 /* Add two margins finally: */152 if (fHasItems)153 iMinimumWidthHint += 2 * iMargin;154 155 149 /* Return result: */ 156 150 return iMinimumWidthHint; … … 160 154 { 161 155 /* Prepare variables: */ 162 int iMargin = data(GroupData_Margin).toInt();163 int iSpacing = data(GroupData_Spacing).toInt();156 const int iMargin = data(GroupData_Margin).toInt(); 157 const int iSpacing = data(GroupData_Spacing).toInt(); 164 158 int iMinimumHeightHint = 0; 159 bool fHasItems = false; 165 160 166 161 /* For each the set we have: */ 167 bool fHasItems = false;168 162 foreach (UIDetailsItem *pItem, items()) 169 163 { … … 307 301 /* Layout hints: */ 308 302 case GroupData_Margin: return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 6; 309 case GroupData_Spacing: return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 2;303 case GroupData_Spacing: return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 6; 310 304 /* Default: */ 311 305 default: break; -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsSet.cpp
r74044 r74111 300 300 { 301 301 /* Prepare variables: */ 302 int iMargin = data(SetData_Margin).toInt();303 int iSpacing = data(SetData_Spacing).toInt();304 int iMaximumWidth = geometry().size().toSize().width();305 int iVerticalIndent = iMargin;302 const int iMargin = data(SetData_Margin).toInt(); 303 const int iSpacing = data(SetData_Spacing).toInt(); 304 const int iMaximumWidth = geometry().size().toSize().width(); 305 int iVerticalIndent = 0; 306 306 307 307 /* Layout all the elements: */ … … 329 329 { 330 330 /* Move element: */ 331 pElement->setPos( iMargin, iVerticalIndent);331 pElement->setPos(0, iVerticalIndent); 332 332 /* Calculate required width: */ 333 int iWidth = iMaximumWidth - 2 * iMargin;333 int iWidth = iMaximumWidth; 334 334 if (pElement->elementType() == DetailsElementType_General || 335 335 pElement->elementType() == DetailsElementType_System) … … 345 345 /* Acquire required height: */ 346 346 int iHeight = pElement->minimumHeightHint(); 347 if (pElement->elementType() == DetailsElementType_System) 348 if (UIDetailsElement *pPreviewElement = element(DetailsElementType_Preview)) 349 if (pPreviewElement->isVisible()) 350 { 351 int iSpareHeight = pPreviewElement->minimumHeightHint(); 352 if (UIDetailsElement *pGeneralElement = element(DetailsElementType_General)) 353 if (pGeneralElement->isVisible()) 354 iSpareHeight -= (iSpacing + pGeneralElement->minimumHeightHint()); 355 iHeight = qMax(iHeight, iSpareHeight); 356 } 347 357 /* If element height is wrong: */ 348 358 if (pElement->geometry().height() != iHeight) … … 363 373 int iHeight = pElement->minimumHeightHint(); 364 374 /* Move element: */ 365 pElement->setPos(iMaximumWidth - i Margin - iWidth, iMargin);375 pElement->setPos(iMaximumWidth - iWidth, iMargin); 366 376 /* Resize element: */ 367 377 pElement->resize(iWidth, iHeight); … … 384 394 385 395 /* Prepare variables: */ 386 int iMargin = data(SetData_Margin).toInt(); 387 int iSpacing = data(SetData_Spacing).toInt(); 396 const int iSpacing = data(SetData_Spacing).toInt(); 388 397 int iMinimumWidthHint = 0; 389 398 … … 428 437 } 429 438 430 /* And two margins finally: */431 iMinimumWidthHint += 2 * iMargin;432 433 439 /* Return result: */ 434 440 return iMinimumWidthHint; … … 546 552 /* Layout hints: */ 547 553 case SetData_Margin: return 0; 548 case SetData_Spacing: return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 5;554 case SetData_Spacing: return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 6; 549 555 /* Default: */ 550 556 default: break;
Note:
See TracChangeset
for help on using the changeset viewer.