- Timestamp:
- Nov 6, 2012 9:43:09 AM (12 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.cpp
r43809 r43810 362 362 case GroupItemData_EnterButtonSize: return m_pEnterButton ? m_pEnterButton->minimumSizeHint().toSize() : QSize(0, 0); 363 363 case GroupItemData_ExitButtonSize: return m_pExitButton ? m_pExitButton->minimumSizeHint().toSize() : QSize(0, 0); 364 case GroupItemData_MinimumNameSize:365 {366 if (isMainRoot())367 return QSize(0, 0);368 QPaintDevice *pPaintDevice = model()->paintDevice();369 QFontMetrics fm(m_nameFont, pPaintDevice);370 int iMaximumTextWidth = textWidth(m_nameFont, pPaintDevice, 20);371 QString strCompressedName = compressText(m_nameFont, pPaintDevice, m_strName, iMaximumTextWidth);372 return QSize(fm.width(strCompressedName), fm.height());373 }374 364 case GroupItemData_NameSize: return isMainRoot() ? QSize(0, 0) : textSize(m_nameFont, model()->paintDevice(), 375 365 data(GroupItemData_Name).toString()); … … 514 504 QSize exitButtonSize = data(GroupItemData_ExitButtonSize).toSize(); 515 505 QSize toggleButtonSize = data(GroupItemData_ToggleButtonSize).toSize(); 516 QSize minimumNameSize = data(GroupItemData_MinimumNameSize).toSize();517 506 QSize groupPixmapSize = data(GroupItemData_GroupPixmapSize).toSize(); 518 507 QSize groupCountTextSize = data(GroupItemData_GroupCountTextSize).toSize(); … … 520 509 QSize machineCountTextSize = data(GroupItemData_MachineCountTextSize).toSize(); 521 510 QSize enterButtonSize = data(GroupItemData_EnterButtonSize).toSize(); 511 512 /* Calculate minimum visible name size: */ 513 QPaintDevice *pPaintDevice = model()->paintDevice(); 514 QFontMetrics fm(m_nameFont, pPaintDevice); 515 int iMaximumNameWidth = textWidth(m_nameFont, pPaintDevice, 20); 516 QString strCompressedName = compressText(m_nameFont, pPaintDevice, m_strName, iMaximumNameWidth); 517 int iMinimumNameWidth = fm.width(strCompressedName); 518 int iMinimumNameHeight = fm.height(); 522 519 523 520 /* Calculate minimum width: */ … … 531 528 iMajorSpacing + 532 529 /* Minimum name width: */ 533 minimumNameSize.width()+530 iMinimumNameWidth + 534 531 /* Spacing between name and info: */ 535 532 iMajorSpacing; … … 554 551 heights << toggleButtonSize.height(); 555 552 heights /* Minimum name height: */ 556 << minimumNameSize.height()553 << iMinimumNameHeight 557 554 /* Group info height: */ 558 555 << groupPixmapSize.height() << groupCountTextSize.height() -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.h
r43809 r43810 116 116 GroupItemData_EnterButtonSize, 117 117 GroupItemData_ExitButtonSize, 118 GroupItemData_MinimumNameSize,119 118 GroupItemData_NameSize, 120 119 GroupItemData_GroupPixmapSize,
Note:
See TracChangeset
for help on using the changeset viewer.