Changeset 83846 in webkit


Ignore:
Timestamp:
Apr 14, 2011 6:17:18 AM (13 years ago)
Author:
diegohcg@webkit.org
Message:

2011-04-14 Diego Gonzalez <diegohcg@webkit.org>

[Qt] Improve disable style for input elements in mobile theme
https://bugs.webkit.org/show_bug.cgi?id=58480

Reviewed by Kenneth Rohde Christiansen.

  • platform/qt/QtMobileWebStyle.cpp:

(QtMobileWebStyle::drawControl):
(QtMobileWebStyle::drawPrimitive):
(QtMobileWebStyle::drawComplexControl):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r83845 r83846  
     12011-04-14  Diego Gonzalez  <diegohcg@webkit.org>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        [Qt] Improve disable style for input elements in mobile theme
     6        https://bugs.webkit.org/show_bug.cgi?id=58480
     7
     8        * platform/qt/QtMobileWebStyle.cpp:
     9        (QtMobileWebStyle::drawControl):
     10        (QtMobileWebStyle::drawPrimitive):
     11        (QtMobileWebStyle::drawComplexControl):
     12
    1132011-04-14  Pavel Feldman  <pfeldman@google.com>
    214
  • trunk/Source/WebCore/platform/qt/QtMobileWebStyle.cpp

    r83051 r83846  
    174174    }
    175175    case CE_PushButton: {
     176        const bool disabled = !(option->state & State_Enabled);
    176177        QRect rect = option->rect;
    177178        QPen pen(Qt::darkGray, 1.0, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin);
     
    184185        }
    185186
    186         QLinearGradient linearGradient(rect.bottomLeft(), QPoint(rect.bottomLeft().x(), rect.bottomLeft().y() - /* offset limit for gradient */ 20));
    187         linearGradient.setColorAt(0.0, Qt::gray);
    188         linearGradient.setColorAt(0.4, Qt::white);
     187        QLinearGradient linearGradient;
     188        if (disabled) {
     189            linearGradient.setStart(rect.bottomLeft());
     190            linearGradient.setFinalStop(rect.topLeft());
     191            linearGradient.setColorAt(0.0, Qt::gray);
     192            linearGradient.setColorAt(1.0, Qt::white);
     193        } else {
     194            linearGradient.setStart(rect.bottomLeft());
     195            linearGradient.setFinalStop(QPoint(rect.bottomLeft().x(),
     196                        rect.bottomLeft().y() - /* offset limit for gradient */ 20));
     197            linearGradient.setColorAt(0.0, Qt::gray);
     198            linearGradient.setColorAt(0.4, Qt::white);
     199        }
     200
    189201        drawRectangularControlBackground(painter, pen, rect, linearGradient);
    190202        break;
     
    209221        }
    210222
    211         QLinearGradient linearGradient(rect.topLeft(), QPoint(rect.topLeft().x(), rect.topLeft().y() + 20));
     223        QLinearGradient linearGradient;
    212224        if (disabled) {
     225            linearGradient.setStart(rect.topLeft());
     226            linearGradient.setFinalStop(rect.bottomLeft());
    213227            linearGradient.setColorAt(0.0, Qt::lightGray);
    214             linearGradient.setColorAt(0.3, Qt::white);
     228            linearGradient.setColorAt(1.0, Qt::white);
    215229        } else {
     230            linearGradient.setStart(rect.topLeft());
     231            linearGradient.setFinalStop(QPoint(rect.topLeft().x(),
     232                        rect.topLeft().y() + /* offset limit for gradient */ 20));
    216233            linearGradient.setColorAt(0.0, Qt::darkGray);
    217234            linearGradient.setColorAt(0.35, Qt::white);
     
    326343
    327344        QRect rect = option->rect;
    328         QLinearGradient linearGradient(rect.bottomLeft(), QPoint(rect.bottomLeft().x(), rect.bottomLeft().y() - /* offset limit for gradient */ 20));
    329         linearGradient.setColorAt(0.0, Qt::gray);
    330         linearGradient.setColorAt(0.4, Qt::white);
    331345        QPen pen(Qt::darkGray, 1.0, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin);
    332         painter->setPen(pen);
     346        QLinearGradient linearGradient;
     347        if (disabled) {
     348            linearGradient.setStart(rect.bottomLeft());
     349            linearGradient.setFinalStop(rect.topLeft());
     350            linearGradient.setColorAt(0.0, Qt::gray);
     351            linearGradient.setColorAt(1.0, Qt::white);
     352        } else {
     353            linearGradient.setStart(rect.bottomLeft());
     354            linearGradient.setFinalStop(QPoint(rect.bottomLeft().x(),
     355                        rect.bottomLeft().y() - /* offset limit for gradient */ 20));
     356            linearGradient.setColorAt(0.0, Qt::gray);
     357            linearGradient.setColorAt(0.4, Qt::white);
     358        }
     359
    333360        drawRectangularControlBackground(painter, pen, rect, linearGradient);
    334361
Note: See TracChangeset for help on using the changeset viewer.