Changeset 44060 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Dec 7, 2012 1:43:35 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 82546
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElement.cpp
r43989 r44060 103 103 /* Mark animation as non-running: */ 104 104 m_fAnimationRunning = false; 105 106 /* Recursively update size-hint: */ 107 updateGeometry(); 108 /* Repaint: */ 109 update(); 105 110 } 106 111 … … 189 194 190 195 /* Calculate minimum-text-width: */ 191 m_iMinimumTextWidth = 0;196 int iMinimumTextWidth = 0; 192 197 if (fSingleColumnText) 193 198 { 194 199 /* Take into account only left column: */ 195 200 int iMinimumLeftColumnWidth = qMin(iMaximumLeftLineWidth, iMinimumTextColumnWidth); 196 m_iMinimumTextWidth = iMinimumLeftColumnWidth;201 iMinimumTextWidth = iMinimumLeftColumnWidth; 197 202 } 198 203 else … … 201 206 int iMinimumLeftColumnWidth = iMaximumLeftLineWidth; 202 207 int iMinimumRightColumnWidth = qMin(iMaximumRightLineWidth, iMinimumTextColumnWidth); 203 m_iMinimumTextWidth = iMinimumLeftColumnWidth + iSpacing + iMinimumRightColumnWidth; 208 iMinimumTextWidth = iMinimumLeftColumnWidth + iSpacing + iMinimumRightColumnWidth; 209 } 210 211 /* Is there something changed? */ 212 if (m_iMinimumTextWidth != iMinimumTextWidth) 213 { 214 /* Remember new value: */ 215 m_iMinimumTextWidth = iMinimumTextWidth; 216 /* Recursively update size-hint: */ 217 updateGeometry(); 204 218 } 205 219 } … … 248 262 249 263 /* Calculate minimum-text-height: */ 250 m_iMinimumTextHeight = 0;264 int iMinimumTextHeight = 0; 251 265 foreach (const UITextTableLine line, m_text) 252 266 { … … 272 286 273 287 /* Append summary text height: */ 274 m_iMinimumTextHeight += qMax(iLeftColumnHeight, iRightColumnHeight); 288 iMinimumTextHeight += qMax(iLeftColumnHeight, iRightColumnHeight); 289 } 290 291 /* Is there something changed? */ 292 if (m_iMinimumTextHeight != iMinimumTextHeight) 293 { 294 /* Remember new value: */ 295 m_iMinimumTextHeight = iMinimumTextHeight; 296 /* Recursively update size-hint: */ 297 updateGeometry(); 275 298 } 276 299 } … … 382 405 void UIGDetailsElement::updateLayout() 383 406 { 384 /* Update size-hint: */385 updateSizeHint();386 387 407 /* Prepare variables: */ 388 408 QSize size = geometry().size().toSize(); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsGroup.cpp
r44019 r44060 235 235 void UIGDetailsGroup::updateLayout() 236 236 { 237 /* Update size-hints for all the children: */238 foreach (UIGDetailsItem *pItem, items())239 pItem->updateSizeHint();240 /* Update size-hint for this item: */241 updateSizeHint();242 243 237 /* Prepare variables: */ 244 238 int iMargin = data(GroupData_Margin).toInt(); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsItem.cpp
r44019 r44060 85 85 } 86 86 87 void UIGDetailsItem::update SizeHint()87 void UIGDetailsItem::updateGeometry() 88 88 { 89 /* Update the geometry: */ 90 updateGeometry(); 89 /* Call to base-class: */ 90 QIGraphicsWidget::updateGeometry(); 91 92 /* Do the same for the parent: */ 93 if (parentItem()) 94 parentItem()->updateGeometry(); 91 95 } 92 96 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsItem.h
r44019 r44060 77 77 78 78 /* API: Layout stuff: */ 79 void update SizeHint();79 void updateGeometry(); 80 80 virtual int minimumWidthHint() const = 0; 81 81 virtual int minimumHeightHint() const = 0; -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsSet.cpp
r44019 r44060 124 124 /* Show the element: */ 125 125 pElement->show(); 126 /* Recursively update size-hint: */ 127 pElement->updateGeometry(); 126 128 /* Update layout: */ 127 129 model()->updateLayout(); … … 132 134 /* Hide the element: */ 133 135 pElement->hide(); 136 /* Recursively update size-hint: */ 137 updateGeometry(); 134 138 /* Update layout: */ 135 139 model()->updateLayout(); … … 435 439 void UIGDetailsSet::updateLayout() 436 440 { 437 /* Update size-hints for all the items: */438 foreach (UIGDetailsItem *pItem, items())439 pItem->updateSizeHint();440 /* Update size-hint for this item: */441 updateSizeHint();442 443 441 /* Prepare variables: */ 444 442 int iMargin = data(SetData_Margin).toInt(); … … 474 472 /* Move element: */ 475 473 pElement->setPos(iMargin, iVerticalIndent); 476 /* Resize element torequired width: */474 /* Calculate required width: */ 477 475 int iWidth = iMaximumWidth - 2 * iMargin; 478 476 if (pElement->elementType() == DetailsElementType_General || … … 481 479 if (pPreviewElement->isVisible()) 482 480 iWidth -= (iSpacing + pPreviewElement->minimumWidthHint()); 481 /* If element width is wrong: */ 482 if (pElement->geometry().width() != iWidth) 483 { 484 /* Resize element to required width: */ 485 pElement->resize(iWidth, pElement->geometry().height()); 486 /* Update minimum-height-hint: */ 487 pElement->updateMinimumTextHeight(); 488 } 489 /* Acquire required height: */ 483 490 int iHeight = pElement->minimumHeightHint(); 484 pElement->resize(iWidth, iHeight); 485 /* Update minimum-height-hint: */ 486 pElement->updateMinimumTextHeight(); 487 pItem->updateSizeHint(); 488 /* Resize element to required height: */ 489 iHeight = pElement->minimumHeightHint(); 490 pElement->resize(iWidth, iHeight); 491 /* If element height is wrong: */ 492 if (pElement->geometry().height() != iHeight) 493 { 494 /* Resize element to required height: */ 495 pElement->resize(pElement->geometry().width(), iHeight); 496 } 491 497 /* Layout element content: */ 492 498 pItem->updateLayout();
Note:
See TracChangeset
for help on using the changeset viewer.