VirtualBox

Changeset 108128 in vbox


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.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/manager/tools
Files:
2 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: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsItem.h

    r108125 r108128  
    232232          * @param  point         Brings upper-left corner pixmap should be mapped to.
    233233          * @param  font          Brings the text font.
    234           * @param  pPaintDevice  Brings the paint-device reference to initilize painting from. */
     234          * @param  pPaintDevice  Brings the paint-device reference to initilize painting from.
     235          * @param  fPopup        Brings whether it's a text for popup mode, widget mode otherwise. */
    235236        static void paintText(QPainter *pPainter, QPoint point,
    236237                              const QFont &font, QPaintDevice *pPaintDevice,
    237                               const QString &strText);
     238                              const QString &strText,
     239                              bool fPopup);
    238240
    239241#ifndef VBOX_WS_MAC
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