Title: [102934] trunk/Source/WebCore
Revision
102934
Author
[email protected]
Date
2011-12-15 06:59:26 -0800 (Thu, 15 Dec 2011)

Log Message

[Qt] Mobile theme improvements

Rubberstamped by Simon Hausmann.

- Invert the gradient on the checkboxes
- Make the buttons on the multi select combobox work on floats
- Mini cleanups

* platform/qt/RenderThemeQtMobile.cpp:
(WebCore::StylePainterMobile::drawCheckableBackground):
(WebCore::StylePainterMobile::drawMultipleComboButton):
(WebCore::StylePainterMobile::getButtonImageSize):
(WebCore::StylePainterMobile::drawComboBox):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (102933 => 102934)


--- trunk/Source/WebCore/ChangeLog	2011-12-15 14:19:49 UTC (rev 102933)
+++ trunk/Source/WebCore/ChangeLog	2011-12-15 14:59:26 UTC (rev 102934)
@@ -1,3 +1,19 @@
+2011-12-15  Kenneth Rohde Christiansen  <[email protected]>
+
+        [Qt] Mobile theme improvements
+
+        Rubberstamped by Simon Hausmann.
+
+        - Invert the gradient on the checkboxes
+        - Make the buttons on the multi select combobox work on floats
+        - Mini cleanups
+
+        * platform/qt/RenderThemeQtMobile.cpp:
+        (WebCore::StylePainterMobile::drawCheckableBackground):
+        (WebCore::StylePainterMobile::drawMultipleComboButton):
+        (WebCore::StylePainterMobile::getButtonImageSize):
+        (WebCore::StylePainterMobile::drawComboBox):
+
 2011-12-15  Peter Rybin  <[email protected]>
 
         Web Inspector: CodeGeneratorInspector.py convert script conditions to precompiler #ifs

Modified: trunk/Source/WebCore/platform/qt/RenderThemeQtMobile.cpp (102933 => 102934)


--- trunk/Source/WebCore/platform/qt/RenderThemeQtMobile.cpp	2011-12-15 14:19:49 UTC (rev 102933)
+++ trunk/Source/WebCore/platform/qt/RenderThemeQtMobile.cpp	2011-12-15 14:59:26 UTC (rev 102934)
@@ -79,7 +79,7 @@
 static const QColor highlightColor(16, 128, 221);
 static const QColor buttonGradientBottom(245, 245, 245);
 static const QColor shadowColor(80, 80, 80, 160);
-static const QPen borderPen(darkColor, 0.3, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin);
+static const QPen borderPen(darkColor, 0.4, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin);
 
 static inline void drawRectangularControlBackground(QPainter* painter, const QPen& pen, const QRect& rect, const QBrush& brush)
 {
@@ -123,15 +123,17 @@
 void StylePainterMobile::drawCheckableBackground(QPainter* painter, const QRect& rect, bool checked, bool enabled) const
 {
     QBrush brush;
-    if (checked && enabled) {
-        QLinearGradient gradient;
-        gradient.setStart(rect.bottomLeft());
-        gradient.setFinalStop(rect.topLeft());
-        gradient.setColorAt(0.0, highlightColor);
-        gradient.setColorAt(1.0, highlightColor.lighter());
-        brush = gradient;
-    } else
-        brush = Qt::lightGray;
+    QColor color = Qt::gray;
+    if (checked && enabled)
+        color = highlightColor;
+
+    QLinearGradient gradient;
+    gradient.setStart(rect.topLeft());
+    gradient.setFinalStop(rect.bottomLeft());
+    gradient.setColorAt(0.0, color);
+    gradient.setColorAt(1.0, color.lighter());
+    brush = gradient;
+
     drawRectangularControlBackground(painter, borderPen, rect, brush);
 }
 
@@ -209,14 +211,18 @@
 
 void StylePainterMobile::drawMultipleComboButton(QPainter* painter, const QSize& size, const QColor& color) const
 {
-    const int dotSize = size.height() - 1;
+    const qreal dotDiameter = size.height();
+    const qreal dotRadii = dotDiameter / 2;
 
+    painter->setRenderHint(QPainter::Antialiasing, true);
     painter->setPen(color);
     painter->setBrush(color);
 
-    painter->drawEllipse(0, 0, dotSize, dotSize);
-    painter->drawEllipse(dotSize * 2, 0, dotSize, dotSize);
-    painter->drawEllipse(4 * dotSize, 0, dotSize, dotSize);
+    const qreal offsetFactor = 1.6;
+    for (int i = 0; i < 3; ++i) {
+        QPointF center(offsetFactor * dotRadii + i * offsetFactor * dotDiameter, dotRadii);
+        painter->drawEllipse(center, dotRadii, dotRadii);
+    }
 }
 
 void StylePainterMobile::drawSimpleComboButton(QPainter* painter, const QSize& size, const QColor& color) const
@@ -252,7 +258,7 @@
 
     const int height = buttonSize.height() / 2 + frameWidth;
     const int width = height - (2 * (1 + height / 15)) - 1;
-    return QSize(width , height);
+    return QSize(width, height);
 }
 
 QPixmap StylePainterMobile::findComboButton(const QSize& size, bool multiple, bool enabled) const
@@ -342,7 +348,6 @@
     linearGradient.setColorAt(0.0, buttonGradientBottom);
     linearGradient.setColorAt(1.0, Qt::white);
 
-
     drawRectangularControlBackground(painter, borderPen, rect, linearGradient);
 
     const QRect buttonRect(rect.x() + rect.width() - frameWidth - arrowBoxWidth, rect.y() + frameWidth
@@ -513,7 +518,6 @@
     setButtonPadding(style);
 }
 
-
 void RenderThemeQtMobile::setButtonPadding(RenderStyle* style) const
 {
     if (!style)
@@ -592,7 +596,6 @@
     style->setPaddingBottom(Length(2, Fixed));
 }
 
-
 bool RenderThemeQtMobile::paintMenuList(RenderObject* o, const PaintInfo& i, const IntRect& r)
 {
     StylePainterMobile p(this, i);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to