VirtualBox

Changeset 9259 in vbox for trunk/src/VBox


Ignore:
Timestamp:
May 30, 2008 3:52:31 PM (17 years ago)
Author:
vboxsync
Message:

FE/Qt4-OSX: Center the text in the drag pixmap & add some white shadow for dark background.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/src/darwin/VBoxUtils-darwin.cpp

    r9245 r9259  
    103103    QFontMetrics fm (qApp->font());
    104104    QRect tbRect = fm.boundingRect (aText);
    105     const int h = qMax (aPixmap.height(), tbRect.height());
     105    const int h = qMax (aPixmap.height(), fm.ascent() + 1);
    106106    const int m = 2;
    107107    QPixmap dragPixmap (aPixmap.width() + tbRect.width() + m, h);
     
    109109    QPainter painter (&dragPixmap);
    110110    painter.drawPixmap (0, qAbs (h - aPixmap.height()) / 2.0, aPixmap);
    111     painter.drawText (aPixmap.width() + m, qAbs (h - aPixmap.height()) / 2.0 + aPixmap.height(), aText);
     111    painter.setPen (Qt::white);
     112    painter.drawText (QRect (aPixmap.width() + m, 1, tbRect.width(), h - 1), Qt::AlignLeft | Qt::AlignVCenter, aText);
     113    painter.setPen (Qt::black);
     114    painter.drawText (QRect (aPixmap.width() + m, 0, tbRect.width(), h - 1), Qt::AlignLeft | Qt::AlignVCenter, aText);
    112115    painter.end();
    113116    return dragPixmap;
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