diff options
author | Leon Scroggins <scroggo@google.com> | 2009-10-04 15:12:49 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2009-10-04 15:12:49 -0700 |
commit | 026fe6d5a004207846034c539bfd5924629adefa (patch) | |
tree | 5e9269a3cbe4674aae7872c2cb2e522d338abb27 | |
parent | 69b9ab686ccfadd429ac9d67474ae44da9df1113 (diff) | |
parent | 2097884b9e1630c3855a8580f84a308163e085e7 (diff) | |
download | external_webkit-026fe6d5a004207846034c539bfd5924629adefa.zip external_webkit-026fe6d5a004207846034c539bfd5924629adefa.tar.gz external_webkit-026fe6d5a004207846034c539bfd5924629adefa.tar.bz2 |
am 2097884b: Revert "Don\'t extend the arrow asset of the combo box over the text, so that the real background"
Merge commit '2097884b9e1630c3855a8580f84a308163e085e7' into eclair-mr2
* commit '2097884b9e1630c3855a8580f84a308163e085e7':
Revert "Don't extend the arrow asset of the combo box over the text, so that the real background"
-rw-r--r-- | WebCore/platform/android/RenderThemeAndroid.cpp | 10 | ||||
-rw-r--r-- | WebKit/android/RenderSkinCombo.cpp | 9 |
2 files changed, 14 insertions, 5 deletions
diff --git a/WebCore/platform/android/RenderThemeAndroid.cpp b/WebCore/platform/android/RenderThemeAndroid.cpp index 51f404e..0f419f5 100644 --- a/WebCore/platform/android/RenderThemeAndroid.cpp +++ b/WebCore/platform/android/RenderThemeAndroid.cpp @@ -235,7 +235,7 @@ bool RenderThemeAndroid::paintTextArea(RenderObject* obj, const RenderObject::Pa { if (obj->isMenuList()) return paintCombo(obj, info, rect); - return true; + return true; } void RenderThemeAndroid::adjustSearchFieldStyle(CSSStyleSelector*, RenderStyle* style, Element*) const @@ -245,7 +245,7 @@ void RenderThemeAndroid::adjustSearchFieldStyle(CSSStyleSelector*, RenderStyle* bool RenderThemeAndroid::paintSearchField(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { - return true; + return true; } void RenderThemeAndroid::adjustListboxStyle(CSSStyleSelector*, RenderStyle* style, Element*) const @@ -259,6 +259,12 @@ static void adjustMenuListStyleCommon(RenderStyle* style, Element* e) { // Added to make room for our arrow. style->setPaddingRight(Length(RenderSkinCombo::extraWidth(), Fixed)); + // Code copied from RenderThemeMac.mm + // Makes sure that the text shows up on our treatment + bool isEnabled = true; + if (e) + isEnabled = e->isEnabledFormControl(); + style->setColor(isEnabled ? Color::black : Color::darkGray); } void RenderThemeAndroid::adjustMenuListStyle(CSSStyleSelector*, RenderStyle* style, Element* e) const diff --git a/WebKit/android/RenderSkinCombo.cpp b/WebKit/android/RenderSkinCombo.cpp index fd6f1f2..870c13e 100644 --- a/WebKit/android/RenderSkinCombo.cpp +++ b/WebKit/android/RenderSkinCombo.cpp @@ -36,9 +36,9 @@ namespace WebCore { static SkBitmap s_bitmap[2]; // Collection of assets for a combo box static bool s_decoded; // True if all assets were decoded -static const int s_margin = 0; +static const int s_margin = 2; static const SkIRect s_mar = { s_margin, s_margin, - RenderSkinCombo::extraWidth() - 2, s_margin }; + RenderSkinCombo::extraWidth(), s_margin }; RenderSkinCombo::RenderSkinCombo() { @@ -61,8 +61,11 @@ bool RenderSkinCombo::Draw(SkCanvas* canvas, Node* element, int x, int y, int wi return true; State state = (element->isElementNode() && static_cast<Element*>(element)->isEnabledFormControl()) ? kNormal : kDisabled; + if (height < (s_margin<<1) + 1) { + height = (s_margin<<1) + 1; + } SkRect bounds; - bounds.set(SkIntToScalar(x + width), SkIntToScalar(y), SkIntToScalar(x + width), SkIntToScalar(y + height)); + bounds.set(SkIntToScalar(x), SkIntToScalar(y), SkIntToScalar(x + width), SkIntToScalar(y + height)); SkNinePatch::DrawNine(canvas, bounds, s_bitmap[state], s_mar); return false; } |