2009-07-10 Adam Langley <agl@google.com>
authoragl@chromium.org <agl@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Jul 2009 19:10:26 +0000 (19:10 +0000)
committeragl@chromium.org <agl@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Jul 2009 19:10:26 +0000 (19:10 +0000)
        Reviewed by Darin Fisher.

        Chromium Linux: use disabled images for disabled widgets.

        https://bugs.webkit.org/show_bug.cgi?id=27106

        Previously, checkboxes and radio controls rendered the same even if disabled.
        The Chromium side of this change is r20224.

        * rendering/RenderThemeChromiumSkia.cpp:
        (WebCore::RenderThemeChromiumSkia::paintCheckbox):
        (WebCore::RenderThemeChromiumSkia::paintRadio):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@45716 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/rendering/RenderThemeChromiumSkia.cpp

index ca85ebbc40574c1ef74c3e00beb895496e7908da..537422ee3d060e300c5d4964c539e19484af096b 100644 (file)
@@ -1,3 +1,18 @@
+2009-07-10  Adam Langley  <agl@google.com>
+
+        Reviewed by Darin Fisher.
+
+        Chromium Linux: use disabled images for disabled widgets.
+
+        https://bugs.webkit.org/show_bug.cgi?id=27106
+
+        Previously, checkboxes and radio controls rendered the same even if disabled.
+        The Chromium side of this change is r20224.
+
+        * rendering/RenderThemeChromiumSkia.cpp:
+        (WebCore::RenderThemeChromiumSkia::paintCheckbox):
+        (WebCore::RenderThemeChromiumSkia::paintRadio):
+
 2009-07-10  Simon Fraser  <simon.fraser@apple.com>
 
         Reviewed by John Sullivan.
index c09e3f6d8f90abf0d3b5ebafca6261de748b0d24..95ffd029369f6657345d6d9ce557fb73c9d249a4 100644 (file)
@@ -212,8 +212,16 @@ bool RenderThemeChromiumSkia::paintCheckbox(RenderObject* o, const RenderObject:
 {
     static Image* const checkedImage = Image::loadPlatformResource("linuxCheckboxOn").releaseRef();
     static Image* const uncheckedImage = Image::loadPlatformResource("linuxCheckboxOff").releaseRef();
+    static Image* const disabledCheckedImage = Image::loadPlatformResource("linuxCheckboxDisabledOn").releaseRef();
+    static Image* const disabledUncheckedImage = Image::loadPlatformResource("linuxCheckboxDisabledOff").releaseRef();
+
+    Image* image;
+
+    if (this->isEnabled(o))
+        image = this->isChecked(o) ? checkedImage : uncheckedImage;
+    else
+        image = this->isChecked(o) ? disabledCheckedImage : disabledUncheckedImage;
 
-    Image* image = this->isChecked(o) ? checkedImage : uncheckedImage;
     i.context->drawImage(image, rect);
     return false;
 }
@@ -237,8 +245,15 @@ bool RenderThemeChromiumSkia::paintRadio(RenderObject* o, const RenderObject::Pa
 {
     static Image* const checkedImage = Image::loadPlatformResource("linuxRadioOn").releaseRef();
     static Image* const uncheckedImage = Image::loadPlatformResource("linuxRadioOff").releaseRef();
+    static Image* const disabledCheckedImage = Image::loadPlatformResource("linuxRadioDisabledOn").releaseRef();
+    static Image* const disabledUncheckedImage = Image::loadPlatformResource("linuxRadioDisabledOff").releaseRef();
+
+    Image* image;
+    if (this->isEnabled(o))
+        image = this->isChecked(o) ? checkedImage : uncheckedImage;
+    else
+        image = this->isChecked(o) ? disabledCheckedImage : disabledUncheckedImage;
 
-    Image* image = this->isChecked(o) ? checkedImage : uncheckedImage;
     i.context->drawImage(image, rect);
     return false;
 }