From: Zev W. <ze...@be...> - 2014-07-27 00:49:06
|
Hello, This patch changes the background color of the protocol legend to black. Some colors (white, light grey, yellow...) are basically unreadable on the default grey background; with a black background (like the main diagram canvas) they're much more readable. Note that I know basically nothing about GTK; hence I'm not sure if directly re-using the style object from the background instead of creating a new one is kosher or not, but in my own testing I haven't seen it cause any problems. Thanks, Zev Weiss commit 6b501c7b7244deff049e5ee4fe1de06cb80f1ffb Author: Zev Weiss <ze...@be...> Date: 2014-07-26 19:43:14 -0500 Make protocol legend background black. diff --git a/glade/etherape.glade b/glade/etherape.glade index a8f9406..1928a62 100644 --- a/glade/etherape.glade +++ b/glade/etherape.glade @@ -2420,7 +2420,7 @@ Daniel Nylander <property name="hscrollbar_policy">never</property> <property name="vscrollbar_policy">automatic</property> <child> - <widget class="GtkViewport" id="viewport1"> + <widget class="GtkViewport" id="legend_viewport"> <property name="visible">True</property> <property name="resize_mode">queue</property> <property name="shadow_type">none</property> diff --git a/src/diagram.c b/src/diagram.c index 6393c25..4a073ab 100644 --- a/src/diagram.c +++ b/src/diagram.c @@ -226,6 +226,7 @@ init_diagram (GladeXML *xml) { GtkStyle *style; GtkWidget *canvas; + GtkWidget *viewport; /* Creates trees */ canvas_nodes = g_tree_new_full ( (GCompareDataFunc)canvas_node_compare, @@ -248,6 +249,11 @@ init_diagram (GladeXML *xml) gtk_widget_set_style (canvas, style); gtk_style_set_background (canvas->style, canvas->window, GTK_STATE_NORMAL); + /* Set protocol legend background to black */ + viewport = glade_xml_get_widget (appdata.xml, "legend_viewport"); + gtk_widget_set_style (viewport, style); + gtk_style_set_background (viewport->style, viewport->window, GTK_STATE_NORMAL); + /* Initialize the known_protocols table */ delete_gui_protocols (); |