VirtualBox

Changeset 108009 in vbox


Ignore:
Timestamp:
Jan 31, 2025 9:09:30 PM (3 weeks ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
167281
Message:

FE/Qt: bugref:10814: VBox Manager / Tools pane: Hovering background for tool item in widget mode.

File:
1 edited

Legend:

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

    r108008 r108009  
    437437    setFlag(QGraphicsItem::ItemIsSelectable, false);
    438438
    439     /* Prepare hover animation: */
    440     prepareHoverAnimation();
     439    /* Prepare hover animation for popup mode only: */
     440    if (model()->tools()->isPopup())
     441        prepareHoverAnimation();
    441442    /* Prepare connections: */
    442443    prepareConnections();
     
    732733            pPainter->fillRect(tokenRect, hlGrad);
    733734        }
     735
     736        /* Hovering background for widget: */
     737        if (isHovered())
     738        {
     739            /* Configure painter: */
     740            pPainter->setRenderHint(QPainter::Antialiasing, true);
     741            /* Acquire background color: */
     742            const QColor backgroundColor = pal.color(QPalette::Window);
     743
     744            /* Prepare icon sub-rect: */
     745            QRect subRect;
     746            subRect.setHeight(24 + 4 * 2);
     747            subRect.setWidth(subRect.height());
     748            subRect.moveCenter(rectangle.center());
     749
     750            /* Paint icon frame: */
     751            QPainterPath painterPath;
     752            painterPath.addRoundedRect(subRect, 4, 4);
     753            const QColor backgroundColor1 = uiCommon().isInDarkMode()
     754                                          ? backgroundColor.lighter(110)
     755                                          : backgroundColor.darker(105);
     756            pPainter->setPen(QPen(backgroundColor1, 2, Qt::SolidLine, Qt::RoundCap));
     757            pPainter->drawPath(QPainterPathStroker().createStroke(painterPath));
     758
     759            /* Fill icon body: */
     760            pPainter->setClipPath(painterPath);
     761            const QColor backgroundColor2 = uiCommon().isInDarkMode()
     762                                          ? backgroundColor.lighter(180)
     763                                          : backgroundColor.darker(140);
     764            pPainter->fillRect(subRect, backgroundColor2);
     765        }
    734766    }
    735767
Note: See TracChangeset for help on using the changeset viewer.

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