VirtualBox

Changeset 107396 in vbox for trunk/src


Ignore:
Timestamp:
Dec 24, 2024 10:26:51 AM (4 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
166445
Message:

FE/Qt: bugref:10814: VBox Manager / Tool-pane: A bit of look&feel changes for widget mode item painting.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsItem.cpp

    r107388 r107396  
    444444    /* Paint background: */
    445445    paintBackground(pPainter, rectangle);
    446     /* Paint frame: */
    447     paintFrame(pPainter, rectangle);
     446    /* Paint frame for popup only: */
     447    if (model()->tools()->isPopup())
     448        paintFrame(pPainter, rectangle);
    448449    /* Paint tool info: */
    449450    paintToolInfo(pPainter, rectangle);
     
    743744    const QPalette pal = QApplication::palette();
    744745
    745     /* Selection background: */
    746     if (model()->currentItem() == this)
     746    /* Selection background for popup: */
     747    if (   model()->currentItem() == this
     748        && model()->tools()->isPopup())
    747749    {
    748750        /* Prepare color: */
     
    782784        }
    783785    }
     786    /* Selection background for widget: */
     787    else if (   model()->currentItem() == this
     788             && !model()->tools()->isPopup())
     789
     790    {
     791            /* Prepare color: */
     792            const QColor highlightColor = isEnabled()
     793                                        ? pal.color(QPalette::Active, QPalette::Highlight)
     794                                        : pal.color(QPalette::Disabled, QPalette::Highlight);
     795            QRect tokenRect(rectangle.topLeft() + QPoint(0, 4),
     796                            QSize(4, rectangle.height() - 8));
     797            /* Draw gradient token: */
     798            QLinearGradient hlGrad(tokenRect.topLeft(), tokenRect.bottomLeft());
     799            hlGrad.setColorAt(0, highlightColor.darker(m_iHighlightLightnessStart));
     800            hlGrad.setColorAt(1, highlightColor.darker(m_iHighlightLightnessFinal));
     801            pPainter->fillRect(tokenRect, hlGrad);
     802    }
    784803    /* Hovering background: */
    785804    else if (isHovered())
     
    821840        }
    822841    }
    823     /* Default background: */
    824     else
     842    /* Default background for popup only: */
     843    else if (model()->tools()->isPopup())
    825844    {
    826845        /* Prepare color: */
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