Skip to content

Commit

Permalink
Merge r172958 - [GTK] Selection background is rendered white when unf…
Browse files Browse the repository at this point in the history
…ocused with recent GTK+

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

Reviewed by Martin Robinson.

This is due to a change in the GTK+ theme, but because we are not
using the right flags to get the selections colors. We should use
GTK_STATE_FLAG_SELECTED | GTK_STATE_FLAG_FOCUSED when focused and
GTK_STATE_FLAG_SELECTED when unfocused, instead of
GTK_STATE_FLAG_ACTIVE when unfocused.

* platform/gtk/RenderThemeGtk3.cpp:
(WebCore::RenderThemeGtk::platformActiveSelectionBackgroundColor):
(WebCore::RenderThemeGtk::platformInactiveSelectionBackgroundColor):
(WebCore::RenderThemeGtk::platformActiveSelectionForegroundColor):
(WebCore::RenderThemeGtk::platformInactiveSelectionForegroundColor):
(WebCore::RenderThemeGtk::platformActiveListBoxSelectionBackgroundColor):
(WebCore::RenderThemeGtk::platformInactiveListBoxSelectionBackgroundColor):
(WebCore::RenderThemeGtk::platformActiveListBoxSelectionForegroundColor):
(WebCore::RenderThemeGtk::platformInactiveListBoxSelectionForegroundColor):
  • Loading branch information
carlosgcampos committed Sep 25, 2014
1 parent 9778814 commit 63a6b7d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 8 deletions.
23 changes: 23 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,26 @@
2014-08-26 Carlos Garcia Campos <cgarcia@igalia.com>

[GTK] Selection background is rendered white when unfocused with recent GTK+
https://bugs.webkit.org/show_bug.cgi?id=136251

Reviewed by Martin Robinson.

This is due to a change in the GTK+ theme, but because we are not
using the right flags to get the selections colors. We should use
GTK_STATE_FLAG_SELECTED | GTK_STATE_FLAG_FOCUSED when focused and
GTK_STATE_FLAG_SELECTED when unfocused, instead of
GTK_STATE_FLAG_ACTIVE when unfocused.

* platform/gtk/RenderThemeGtk3.cpp:
(WebCore::RenderThemeGtk::platformActiveSelectionBackgroundColor):
(WebCore::RenderThemeGtk::platformInactiveSelectionBackgroundColor):
(WebCore::RenderThemeGtk::platformActiveSelectionForegroundColor):
(WebCore::RenderThemeGtk::platformInactiveSelectionForegroundColor):
(WebCore::RenderThemeGtk::platformActiveListBoxSelectionBackgroundColor):
(WebCore::RenderThemeGtk::platformInactiveListBoxSelectionBackgroundColor):
(WebCore::RenderThemeGtk::platformActiveListBoxSelectionForegroundColor):
(WebCore::RenderThemeGtk::platformInactiveListBoxSelectionForegroundColor):

2014-09-17 Philippe Normand <pnormand@igalia.com>

[GStreamer] Cannot play Vimeo video
Expand Down
16 changes: 8 additions & 8 deletions Source/WebCore/platform/gtk/RenderThemeGtk3.cpp
Expand Up @@ -935,56 +935,56 @@ GRefPtr<GdkPixbuf> getStockSymbolicIconForWidgetType(GType widgetType, const cha
Color RenderThemeGtk::platformActiveSelectionBackgroundColor() const
{
GdkRGBA gdkRGBAColor;
gtk_style_context_get_background_color(getStyleContext(GTK_TYPE_ENTRY), GTK_STATE_FLAG_SELECTED, &gdkRGBAColor);
gtk_style_context_get_background_color(getStyleContext(GTK_TYPE_ENTRY), static_cast<GtkStateFlags>(GTK_STATE_FLAG_SELECTED | GTK_STATE_FLAG_FOCUSED), &gdkRGBAColor);
return gdkRGBAColor;
}

Color RenderThemeGtk::platformInactiveSelectionBackgroundColor() const
{
GdkRGBA gdkRGBAColor;
gtk_style_context_get_background_color(getStyleContext(GTK_TYPE_ENTRY), GTK_STATE_FLAG_ACTIVE, &gdkRGBAColor);
gtk_style_context_get_background_color(getStyleContext(GTK_TYPE_ENTRY), GTK_STATE_FLAG_SELECTED, &gdkRGBAColor);
return gdkRGBAColor;
}

Color RenderThemeGtk::platformActiveSelectionForegroundColor() const
{
GdkRGBA gdkRGBAColor;
gtk_style_context_get_color(getStyleContext(GTK_TYPE_ENTRY), GTK_STATE_FLAG_SELECTED, &gdkRGBAColor);
gtk_style_context_get_color(getStyleContext(GTK_TYPE_ENTRY), static_cast<GtkStateFlags>(GTK_STATE_FLAG_SELECTED | GTK_STATE_FLAG_FOCUSED), &gdkRGBAColor);
return gdkRGBAColor;
}

Color RenderThemeGtk::platformInactiveSelectionForegroundColor() const
{
GdkRGBA gdkRGBAColor;
gtk_style_context_get_color(getStyleContext(GTK_TYPE_ENTRY), GTK_STATE_FLAG_ACTIVE, &gdkRGBAColor);
gtk_style_context_get_color(getStyleContext(GTK_TYPE_ENTRY), GTK_STATE_FLAG_SELECTED, &gdkRGBAColor);
return gdkRGBAColor;
}

Color RenderThemeGtk::activeListBoxSelectionBackgroundColor() const
{
GdkRGBA gdkRGBAColor;
gtk_style_context_get_background_color(getStyleContext(GTK_TYPE_TREE_VIEW), GTK_STATE_FLAG_SELECTED, &gdkRGBAColor);
gtk_style_context_get_background_color(getStyleContext(GTK_TYPE_TREE_VIEW), static_cast<GtkStateFlags>(GTK_STATE_FLAG_SELECTED | GTK_STATE_FLAG_FOCUSED), &gdkRGBAColor);
return gdkRGBAColor;
}

Color RenderThemeGtk::inactiveListBoxSelectionBackgroundColor() const
{
GdkRGBA gdkRGBAColor;
gtk_style_context_get_background_color(getStyleContext(GTK_TYPE_TREE_VIEW), GTK_STATE_FLAG_ACTIVE, &gdkRGBAColor);
gtk_style_context_get_background_color(getStyleContext(GTK_TYPE_TREE_VIEW), GTK_STATE_FLAG_SELECTED, &gdkRGBAColor);
return gdkRGBAColor;
}

Color RenderThemeGtk::activeListBoxSelectionForegroundColor() const
{
GdkRGBA gdkRGBAColor;
gtk_style_context_get_color(getStyleContext(GTK_TYPE_TREE_VIEW), GTK_STATE_FLAG_SELECTED, &gdkRGBAColor);
gtk_style_context_get_color(getStyleContext(GTK_TYPE_TREE_VIEW), static_cast<GtkStateFlags>(GTK_STATE_FLAG_SELECTED | GTK_STATE_FLAG_FOCUSED), &gdkRGBAColor);
return gdkRGBAColor;
}

Color RenderThemeGtk::inactiveListBoxSelectionForegroundColor() const
{
GdkRGBA gdkRGBAColor;
gtk_style_context_get_color(getStyleContext(GTK_TYPE_TREE_VIEW), GTK_STATE_FLAG_ACTIVE, &gdkRGBAColor);
gtk_style_context_get_color(getStyleContext(GTK_TYPE_TREE_VIEW), GTK_STATE_FLAG_SELECTED, &gdkRGBAColor);
return gdkRGBAColor;
}

Expand Down

0 comments on commit 63a6b7d

Please sign in to comment.