VirtualBox

Changeset 108037 in vbox for trunk/src


Ignore:
Timestamp:
Feb 3, 2025 5:40:24 PM (3 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
167310
Message:

FE/Qt: bugref:10814: VBox Manager / Tools pane: Handle extra-button press, geometry and layout update; For now we handle it the only possible way to toggle name plates.

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  
    293293    /* And Tools-item content to take into account: */
    294294    int iToolsItemWidth = m_pixmapSize.width();
    295     if (model()->tools()->isPopup())
     295    if (   model()->tools()->isPopup()
     296        || model()->showItemNames())
    296297        iToolsItemWidth += iSpacing + m_nameSize.width();
    297298    iProposedWidth += iToolsItemWidth;
     
    865866        const int iNameY = (iFullHeight - m_nameSize.height()) / 2;
    866867        /* Paint name (always for popup mode, if requested otherwise): */
    867         if (model()->tools()->isPopup())
     868        if (   model()->tools()->isPopup()
     869            || model()->showItemNames())
    868870            paintText(/* Painter: */
    869871                      pPainter,
     
    909911    pPainter->setClipPath(painterPath);
    910912    QColor backgroundColor2 = uiCommon().isInDarkMode()
    911                             ? backgroundColor.lighter(150)
    912                             : backgroundColor.darker(150);
     913                            ? backgroundColor.lighter(140)
     914                            : backgroundColor.darker(140);
    913915    pPainter->fillRect(subRect, backgroundColor2);
    914916
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsModel.cpp

    r108005 r108037  
    6666    , m_pScene(0)
    6767    , m_fItemsEnabled(true)
     68    , m_fShowItemNames(false)
    6869{
    6970    prepare();
     
    317318            return pItem;
    318319    return 0;
     320}
     321
     322bool UIToolsModel::showItemNames() const
     323{
     324    return m_fShowItemNames;
    319325}
    320326
     
    436442                        if (pClickedItem)
    437443                        {
     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
    438453                            /* Make clicked item the current one: */
    439454                            if (pClickedItem->isEnabled())
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsModel.h

    r108005 r108037  
    129129        /** Returns the item of passed @a enmType. */
    130130        UIToolsItem *item(UIToolType enmType) const;
     131
     132        /** Returns whether we should show item names. */
     133        bool showItemNames() const;
    131134
    132135        /** Returns whether at least one item hovered. */
     
    270273        /** Holds the root stack. */
    271274        QList<UIToolsItem*>  m_items;
     275
     276        /** Holds whether children should show names. */
     277        bool  m_fShowItemNames;
    272278    /** @} */
    273279
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette