VirtualBox

Ignore:
Timestamp:
Feb 9, 2025 7:49:08 PM (12 days ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
167427
Message:

FE/Qt: bugref:10814: VBox Manager / Tools pane: Making text for widget mode more clear.

File:
1 edited

Legend:

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

    r108127 r108128  
    924924                      model()->paintDevice(),
    925925                      /* Text to paint: */
    926                       m_strName);
     926                      m_strName,
     927                      /* Text for popup mode? */
     928                      model()->tools()->isPopup());
    927929    }
    928930}
     
    939941void UIToolsItem::paintText(QPainter *pPainter, QPoint point,
    940942                            const QFont &font, QPaintDevice *pPaintDevice,
    941                             const QString &strText)
     943                            const QString &strText,
     944                            bool fPopup)
    942945{
    943946    /* Save painter: */
     
    952955
    953956    /* Draw text: */
    954     pPainter->drawText(point, strText);
     957    if (fPopup)
     958        pPainter->drawText(point, strText);
     959    else
     960    {
     961        QPainterPath textPath;
     962        textPath.addText(0, 0, font, strText);
     963        textPath.translate(point);
     964        pPainter->setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing);
     965        pPainter->setPen(QPen(uiCommon().isInDarkMode() ? Qt::black : Qt::white, 2, Qt::SolidLine, Qt::RoundCap));
     966        pPainter->drawPath(QPainterPathStroker().createStroke(textPath));
     967        pPainter->setBrush(uiCommon().isInDarkMode() ? Qt::white: Qt::black);
     968        pPainter->setPen(Qt::NoPen);
     969        pPainter->drawPath(textPath);
     970    }
    955971
    956972    /* Restore painter: */
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