WebKit Bugzilla
Attachment 341720 Details for
Bug 165072
: [GTK] Difficult to read combo box text in dark theme
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-165072-20180531220647.patch (text/plain), 5.17 KB, created by
Carlos Bentzen
on 2018-05-31 18:04:51 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Carlos Bentzen
Created:
2018-05-31 18:04:51 PDT
Size:
5.17 KB
patch
obsolete
>Subversion Revision: 232345 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index fd050fabe293718786e98e63aac8abc74ba181b8..471dc4ec17a32d846a2fede94bea3ac260a94462 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,27 @@ >+2018-05-31 Carlos Eduardo Ramalho <cadubentzen@gmail.com> >+ >+ [GTK] Difficult to read combo box text in dark theme >+ https://bugs.webkit.org/show_bug.cgi?id=165072 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Set listbox foreground color to theme color to fix hard-to-read >+ text color in combo box while using dark theme. Because the problem >+ only happens with GTK, the new code was added inside #if PLATFORM(GTK). >+ >+ No new tests required. ManualTests/gtk/theme.html already covers it. >+ See the "Option Lists" section. >+ >+ * rendering/RenderTheme.cpp: >+ (WebCore::RenderTheme::adjustStyle): >+ Adjust style for ListboxPart as well. >+ (WebCore::RenderTheme::adjustListboxStyle const): Added. >+ * rendering/RenderTheme.h: Add adjustListboxStyle() >+ * rendering/RenderThemeGtk.cpp: >+ (WebCore::RenderThemeGtk::adjustListboxStyle const): >+ Set color to the theme foreground color. >+ * rendering/RenderThemeGtk.h: adjustListboxStyle() overriden. >+ > 2018-05-30 Carlos Eduardo Ramalho <cadubentzen@gmail.com> > > [GTK] Hardcoded text color in input fields >diff --git a/Source/WebCore/rendering/RenderTheme.cpp b/Source/WebCore/rendering/RenderTheme.cpp >index d67e27a34209c553e4c41f0ff10a1d3f9d0edb47..5c5e94968d5816523258dada0d24b54e788cdb74 100644 >--- a/Source/WebCore/rendering/RenderTheme.cpp >+++ b/Source/WebCore/rendering/RenderTheme.cpp >@@ -213,6 +213,10 @@ void RenderTheme::adjustStyle(StyleResolver& styleResolver, RenderStyle& style, > return adjustMenuListStyle(styleResolver, style, element); > case MenulistButtonPart: > return adjustMenuListButtonStyle(styleResolver, style, element); >+#if PLATFORM(GTK) >+ case ListboxPart: >+ return adjustListboxStyle(styleResolver, style, element); >+#endif > case MediaPlayButtonPart: > case MediaCurrentTimePart: > case MediaTimeRemainingPart: >@@ -941,6 +945,12 @@ void RenderTheme::adjustMenuListStyle(StyleResolver&, RenderStyle&, const Elemen > { > } > >+#if PLATFORM(GTK) >+void RenderTheme::adjustListboxStyle(StyleResolver&, RenderStyle&, const Element*) const >+{ >+} >+#endif >+ > #if ENABLE(METER_ELEMENT) > > void RenderTheme::adjustMeterStyle(StyleResolver&, RenderStyle& style, const Element*) const >diff --git a/Source/WebCore/rendering/RenderTheme.h b/Source/WebCore/rendering/RenderTheme.h >index 7daaecc646a9ccb57bdbd065e0ec21b6853925ae..9cd78a5dc99b5e07ed2921400ce4fa89af17b975 100644 >--- a/Source/WebCore/rendering/RenderTheme.h >+++ b/Source/WebCore/rendering/RenderTheme.h >@@ -305,6 +305,10 @@ protected: > virtual void adjustMenuListButtonStyle(StyleResolver&, RenderStyle&, const Element*) const; > virtual bool paintMenuListButtonDecorations(const RenderBox&, const PaintInfo&, const FloatRect&) { return true; } > >+#if PLATFORM(GTK) >+ virtual void adjustListboxStyle(StyleResolver&, RenderStyle&, const Element*) const; >+#endif >+ > virtual bool paintPushButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } > virtual bool paintSquareButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } > >diff --git a/Source/WebCore/rendering/RenderThemeGtk.cpp b/Source/WebCore/rendering/RenderThemeGtk.cpp >index 6f3519d07d5d11588db50805275f64e2651ec81b..28e62b298b7997798b5028d9c60180fd4d9f01de 100644 >--- a/Source/WebCore/rendering/RenderThemeGtk.cpp >+++ b/Source/WebCore/rendering/RenderThemeGtk.cpp >@@ -1135,6 +1135,12 @@ void RenderThemeGtk::adjustTextAreaStyle(StyleResolver&, RenderStyle& style, con > style.setColor(styleColor(Entry, element->isDisabledFormControl() ? GTK_STATE_FLAG_INSENSITIVE : GTK_STATE_FLAG_NORMAL, StyleColorForeground)); > } > >+void RenderThemeGtk::adjustListboxStyle(StyleResolver&, RenderStyle& style, const Element* element) const >+{ >+ if (element) >+ style.setColor(styleColor(ListBox, element->isDisabledFormControl() ? GTK_STATE_FLAG_INSENSITIVE : GTK_STATE_FLAG_NORMAL, StyleColorForeground)); >+} >+ > bool RenderThemeGtk::paintTextArea(const RenderObject& o, const PaintInfo& i, const FloatRect& r) > { > return paintTextField(o, i, r); >diff --git a/Source/WebCore/rendering/RenderThemeGtk.h b/Source/WebCore/rendering/RenderThemeGtk.h >index aef8fed72647431761ab53a291aa03569b5d909b..4eddac034ccbd1824c4eea8735c5aad7443686f5 100644 >--- a/Source/WebCore/rendering/RenderThemeGtk.h >+++ b/Source/WebCore/rendering/RenderThemeGtk.h >@@ -133,6 +133,8 @@ private: > bool paintMenuList(const RenderObject&, const PaintInfo&, const FloatRect&) override; > bool paintMenuListButtonDecorations(const RenderBox&, const PaintInfo&, const FloatRect&) override; > >+ void adjustListboxStyle(StyleResolver&, RenderStyle&, const Element*) const override; >+ > void adjustSearchFieldResultsDecorationPartStyle(StyleResolver&, RenderStyle&, const Element*) const override; > bool paintSearchFieldResultsDecorationPart(const RenderBox&, const PaintInfo&, const IntRect&) override; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 165072
:
341720
|
341751