Changeset 108037 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Feb 3, 2025 5:40:24 PM (3 months ago)
- svn:sync-xref-src-repo-rev:
- 167310
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager/tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsItem.cpp
r108036 r108037 293 293 /* And Tools-item content to take into account: */ 294 294 int iToolsItemWidth = m_pixmapSize.width(); 295 if (model()->tools()->isPopup()) 295 if ( model()->tools()->isPopup() 296 || model()->showItemNames()) 296 297 iToolsItemWidth += iSpacing + m_nameSize.width(); 297 298 iProposedWidth += iToolsItemWidth; … … 865 866 const int iNameY = (iFullHeight - m_nameSize.height()) / 2; 866 867 /* Paint name (always for popup mode, if requested otherwise): */ 867 if (model()->tools()->isPopup()) 868 if ( model()->tools()->isPopup() 869 || model()->showItemNames()) 868 870 paintText(/* Painter: */ 869 871 pPainter, … … 909 911 pPainter->setClipPath(painterPath); 910 912 QColor backgroundColor2 = uiCommon().isInDarkMode() 911 ? backgroundColor.lighter(1 50)912 : backgroundColor.darker(1 50);913 ? backgroundColor.lighter(140) 914 : backgroundColor.darker(140); 913 915 pPainter->fillRect(subRect, backgroundColor2); 914 916 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsModel.cpp
r108005 r108037 66 66 , m_pScene(0) 67 67 , m_fItemsEnabled(true) 68 , m_fShowItemNames(false) 68 69 { 69 70 prepare(); … … 317 318 return pItem; 318 319 return 0; 320 } 321 322 bool UIToolsModel::showItemNames() const 323 { 324 return m_fShowItemNames; 319 325 } 320 326 … … 436 442 if (pClickedItem) 437 443 { 444 /* Toggle the button: */ 445 if (pClickedItem->hasExtraButton()) 446 { 447 m_fShowItemNames = !m_fShowItemNames; 448 foreach (UIToolsItem *pItem, m_items) 449 pItem->updateGeometry(); 450 updateLayout(); 451 } 452 438 453 /* Make clicked item the current one: */ 439 454 if (pClickedItem->isEnabled()) -
trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsModel.h
r108005 r108037 129 129 /** Returns the item of passed @a enmType. */ 130 130 UIToolsItem *item(UIToolType enmType) const; 131 132 /** Returns whether we should show item names. */ 133 bool showItemNames() const; 131 134 132 135 /** Returns whether at least one item hovered. */ … … 270 273 /** Holds the root stack. */ 271 274 QList<UIToolsItem*> m_items; 275 276 /** Holds whether children should show names. */ 277 bool m_fShowItemNames; 272 278 /** @} */ 273 279
Note:
See TracChangeset
for help on using the changeset viewer.