VirtualBox

Changeset 26119 in vbox


Ignore:
Timestamp:
Feb 1, 2010 1:33:15 PM (15 years ago)
Author:
vboxsync
Message:

FE/Qt4: A couple of fixes for wizards parent class: using picture's palette color to paint watermark frame; take into account button's height when calculating watermark's height.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIWizard.cpp

    r26079 r26119  
    2222
    2323/* Global includes */
     24#include <QAbstractButton>
    2425#include <QLayout>
    2526#include <QTextEdit>
     
    6061    QImage imgWatermark = pixWaterMark.toImage();
    6162
     63    /* Use the right-top watermark pixel as frame color */
     64    QRgb rgbFrame = imgWatermark.pixel(imgWatermark.width() - 1, 0);
     65
     66    /* Take into account button's height */
     67    int iPageHeight = height() - button(QWizard::CancelButton)->height();
     68
    6269    /* Create final image on the basis of incoming, applying the rules. */
    63     QImage imgWatermarkNew(imgWatermark.width(), qMax(imgWatermark.height(), height()), imgWatermark.format());
     70    QImage imgWatermarkNew(imgWatermark.width(), qMax(imgWatermark.height(), iPageHeight), imgWatermark.format());
    6471    for (int y = 0; y < imgWatermarkNew.height(); ++ y)
    6572    {
     
    6976            if (wizardStyle() == QWizard::ClassicStyle &&
    7077                (x == 0 || y == 0 || x == imgWatermarkNew.width() - 1 || y == imgWatermarkNew.height() - 1))
    71                 imgWatermarkNew.setPixel(x, y, qRgb(0, 0, 0));
     78                imgWatermarkNew.setPixel(x, y, rgbFrame);
    7279            /* Border rule 2 - draw border for ModernStyle */
    7380            else if (wizardStyle() == QWizard::ModernStyle && x == imgWatermarkNew.width() - 1)
    74                 imgWatermarkNew.setPixel(x, y, qRgb(0, 0, 0));
     81                imgWatermarkNew.setPixel(x, y, rgbFrame);
    7582            /* Horizontal extension rule - use last used color */
    7683            else if (x >= imgWatermark.width() && y < imgWatermark.height())
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