Wireshark-bugs: [Wireshark-bugs] [Bug 6624] Gtk3 package byte highlighter colour fix

Date: Tue, 29 Nov 2011 07:55:24 -0800 (PST)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6624

--- Comment #3 from Anders Broman <anders.broman@xxxxxxxxxxxx> 2011-11-29 07:55:23 PST ---
(In reply to comment #2)
> thanks for the comment, I guess another incompatibility between gtk3.0 and
> gtk3.2 ... I'm not a gtk programmer, I only tried to make the minimal mods to
> get it work for me.
> 
> does the highlighting work properly for you in gtk3.0 (blue background with
> white text, as in the tree view?) as it doesn't for me in 3.2 (shows black text
> on very light grey, hardly to contrast from black on white

Yes it works fine can you try this reworked patch and see if it works for you?
I can't build with GTK 3.2 I get 
implicit declaration of function ‘gtk_vbox_new etc.

Index: gtk/main_proto_draw.c
===================================================================
--- gtk/main_proto_draw.c       (revision 40034)
+++ gtk/main_proto_draw.c       (working copy)
@@ -715,21 +715,19 @@
     gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(byte_view), FALSE);
     buf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(byte_view));
 #if GTK_CHECK_VERSION(3,0,0)
-    context = gtk_widget_get_style_context (GTK_WIDGET(top_level));
-    gtk_style_context_get (context, GTK_STATE_SELECTED,
-                    "background-color", &rgba_bg_color,
-                    NULL);
-    gtk_style_context_get (context, GTK_STATE_SELECTED,
-                    "color", &rgba_fg_color,
-                    NULL);
-       /* Hack */
-       bg_color.red   = rgba_bg_color->red * 65535;
-       bg_color.green = rgba_bg_color->green * 65535;
-       bg_color.blue  = rgba_bg_color->blue * 65535;
+    context = gtk_widget_get_style_context (GTK_WIDGET(byte_view));
+    gtk_style_context_get (context, GTK_STATE_FLAG_SELECTED,
+                    GTK_STYLE_PROPERTY_BACKGROUND_COLOR, &rgba_bg_color,
+                    GTK_STYLE_PROPERTY_COLOR, &rgba_fg_color,
+                     NULL);
+    /* Hack */
+    bg_color.red   = rgba_bg_color->red * 65535;
+    bg_color.green = rgba_bg_color->green * 65535;
+    bg_color.blue  = rgba_bg_color->blue * 65535;

-       fg_color.red   = rgba_fg_color->red * 65535;
-       fg_color.green = rgba_fg_color->green * 65535;
-       fg_color.blue  = rgba_fg_color->blue * 65535;
+    fg_color.red   = rgba_fg_color->red * 65535;
+    fg_color.green = rgba_fg_color->green * 65535;
+    fg_color.blue  = rgba_fg_color->blue * 65535;

     gtk_text_buffer_create_tag(buf, "plain", "font-desc",
user_font_get_regular(), NULL);
     gtk_text_buffer_create_tag(buf, "reverse",

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.