Changeset 108128 in vbox
- Timestamp:
- Feb 9, 2025 7:49:08 PM (12 days ago)
- svn:sync-xref-src-repo-rev:
- 167427
- 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 924 924 model()->paintDevice(), 925 925 /* Text to paint: */ 926 m_strName); 926 m_strName, 927 /* Text for popup mode? */ 928 model()->tools()->isPopup()); 927 929 } 928 930 } … … 939 941 void UIToolsItem::paintText(QPainter *pPainter, QPoint point, 940 942 const QFont &font, QPaintDevice *pPaintDevice, 941 const QString &strText) 943 const QString &strText, 944 bool fPopup) 942 945 { 943 946 /* Save painter: */ … … 952 955 953 956 /* 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 } 955 971 956 972 /* Restore painter: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsItem.h
r108125 r108128 232 232 * @param point Brings upper-left corner pixmap should be mapped to. 233 233 * @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. */ 235 236 static void paintText(QPainter *pPainter, QPoint point, 236 237 const QFont &font, QPaintDevice *pPaintDevice, 237 const QString &strText); 238 const QString &strText, 239 bool fPopup); 238 240 239 241 #ifndef VBOX_WS_MAC
Note:
See TracChangeset
for help on using the changeset viewer.