Changeset 142423 in webkit


Ignore:
Timestamp:
Feb 10, 2013 6:54:14 PM (11 years ago)
Author:
aelias@chromium.org
Message:

[chromium] Fix Android scrollbar size
https://bugs.webkit.org/show_bug.cgi?id=109374

Reviewed by James Robinson.

This shrinks scrollbars to 3 device-independent pixels (usually 6
physical pixels) and deletes the edge fade. Although the Android
system theme does have an edge fade, it's a much sharper cliff
than we had (against black, the colors go 64 -> 64 -> 52 -> 21 -> 0)
and I can't perceive any difference compared with no fade at all.

No new tests (due for rewrite in a week anyway).

  • platform/chromium/ScrollbarThemeChromiumAndroid.cpp:

(WebCore):
(WebCore::ScrollbarThemeChromiumAndroid::paintThumb):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r142419 r142423  
     12013-02-10  Alexandre Elias  <aelias@chromium.org>
     2
     3        [chromium] Fix Android scrollbar size
     4        https://bugs.webkit.org/show_bug.cgi?id=109374
     5
     6        Reviewed by James Robinson.
     7
     8        This shrinks scrollbars to 3 device-independent pixels (usually 6
     9        physical pixels) and deletes the edge fade. Although the Android
     10        system theme does have an edge fade, it's a much sharper cliff
     11        than we had (against black, the colors go 64 -> 64 -> 52 -> 21 -> 0)
     12        and I can't perceive any difference compared with no fade at all.
     13
     14        No new tests (due for rewrite in a week anyway).
     15
     16        * platform/chromium/ScrollbarThemeChromiumAndroid.cpp:
     17        (WebCore):
     18        (WebCore::ScrollbarThemeChromiumAndroid::paintThumb):
     19
    1202013-02-04  Kentaro Hara  <haraken@chromium.org>
    221
  • trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumAndroid.cpp

    r129837 r142423  
    3838namespace WebCore {
    3939
    40 static const int scrollbarWidth = 8;
    41 static const int scrollbarMargin = 5;
     40static const int scrollbarWidth = 3;
     41static const int scrollbarMargin = 4;
    4242
    4343ScrollbarTheme* ScrollbarTheme::nativeTheme()
     
    105105}
    106106
    107 static void fillSmoothEdgedRect(GraphicsContext* context, const IntRect& rect, const Color& color)
    108 {
    109     Color halfColor(color.red(), color.green(), color.blue(), color.alpha() / 2);
    110 
    111     IntRect topRect = rect;
    112     topRect.inflateX(-1);
    113     topRect.setHeight(1);
    114     context->fillRect(topRect, halfColor, ColorSpaceDeviceRGB);
    115 
    116     IntRect leftRect = rect;
    117     leftRect.inflateY(-1);
    118     leftRect.setWidth(1);
    119     context->fillRect(leftRect, halfColor, ColorSpaceDeviceRGB);
    120 
    121     IntRect centerRect = rect;
    122     centerRect.inflate(-1);
    123     context->fillRect(centerRect, color, ColorSpaceDeviceRGB);
    124 
    125     IntRect rightRect = rect;
    126     rightRect.inflateY(-1);
    127     rightRect.setX(centerRect.maxX());
    128     rightRect.setWidth(1);
    129     context->fillRect(rightRect, halfColor, ColorSpaceDeviceRGB);
    130 
    131     IntRect bottomRect = rect;
    132     bottomRect.inflateX(-1);
    133     bottomRect.setY(centerRect.maxY());
    134     bottomRect.setHeight(1);
    135     context->fillRect(bottomRect, halfColor, ColorSpaceDeviceRGB);
    136 }
    137 
    138107void ScrollbarThemeChromiumAndroid::paintThumb(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect)
    139108{
     
    143112    else
    144113        thumbRect.setWidth(thumbRect.width() - scrollbarMargin);
    145     fillSmoothEdgedRect(context, thumbRect, Color(128, 128, 128, 128));
     114    context->fillRect(thumbRect, Color(128, 128, 128, 128), ColorSpaceDeviceRGB);
    146115}
    147116
Note: See TracChangeset for help on using the changeset viewer.