Changeset 83846 in webkit
- Timestamp:
- Apr 14, 2011 6:17:18 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r83845 r83846 1 2011-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 1 13 2011-04-14 Pavel Feldman <pfeldman@google.com> 2 14 -
trunk/Source/WebCore/platform/qt/QtMobileWebStyle.cpp
r83051 r83846 174 174 } 175 175 case CE_PushButton: { 176 const bool disabled = !(option->state & State_Enabled); 176 177 QRect rect = option->rect; 177 178 QPen pen(Qt::darkGray, 1.0, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin); … … 184 185 } 185 186 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 189 201 drawRectangularControlBackground(painter, pen, rect, linearGradient); 190 202 break; … … 209 221 } 210 222 211 QLinearGradient linearGradient (rect.topLeft(), QPoint(rect.topLeft().x(), rect.topLeft().y() + 20));223 QLinearGradient linearGradient; 212 224 if (disabled) { 225 linearGradient.setStart(rect.topLeft()); 226 linearGradient.setFinalStop(rect.bottomLeft()); 213 227 linearGradient.setColorAt(0.0, Qt::lightGray); 214 linearGradient.setColorAt( 0.3, Qt::white);228 linearGradient.setColorAt(1.0, Qt::white); 215 229 } else { 230 linearGradient.setStart(rect.topLeft()); 231 linearGradient.setFinalStop(QPoint(rect.topLeft().x(), 232 rect.topLeft().y() + /* offset limit for gradient */ 20)); 216 233 linearGradient.setColorAt(0.0, Qt::darkGray); 217 234 linearGradient.setColorAt(0.35, Qt::white); … … 326 343 327 344 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);331 345 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 333 360 drawRectangularControlBackground(painter, pen, rect, linearGradient); 334 361
Note: See TracChangeset
for help on using the changeset viewer.