Title: [174150] releases/WebKitGTK/webkit-2.2/Source/WebCore
Revision
174150
Author
carlo...@webkit.org
Date
2014-10-01 01:39:53 -0700 (Wed, 01 Oct 2014)

Log Message

Merge r172958 - [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):

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.2/Source/WebCore/ChangeLog (174149 => 174150)


--- releases/WebKitGTK/webkit-2.2/Source/WebCore/ChangeLog	2014-10-01 08:33:53 UTC (rev 174149)
+++ releases/WebKitGTK/webkit-2.2/Source/WebCore/ChangeLog	2014-10-01 08:39:53 UTC (rev 174150)
@@ -1,3 +1,26 @@
+2014-08-26  Carlos Garcia Campos  <cgar...@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):
+
 2013-08-28  Sergio Villar Senin  <svil...@igalia.com>
 
         [Soup] WebTiming information not shown in the inspector

Modified: releases/WebKitGTK/webkit-2.2/Source/WebCore/platform/gtk/RenderThemeGtk3.cpp (174149 => 174150)


--- releases/WebKitGTK/webkit-2.2/Source/WebCore/platform/gtk/RenderThemeGtk3.cpp	2014-10-01 08:33:53 UTC (rev 174149)
+++ releases/WebKitGTK/webkit-2.2/Source/WebCore/platform/gtk/RenderThemeGtk3.cpp	2014-10-01 08:39:53 UTC (rev 174150)
@@ -931,56 +931,56 @@
 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;
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to