aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2010-02-20 00:10:56 -0500
committerSteven Rostedt <rostedt@goodmis.org>2010-02-20 00:10:56 -0500
commit0c4b06bd4bd6d86f42186fec1e423c8e80e33964 (patch)
tree3f7c93273a25c50d67a5d0f83e44704dede57379
parent8ed155d74ecd8b436ec475770f02172bb570d580 (diff)
trace-graph: Have marker labels have the color of their lines
Change the "A:" and "B:" to have the same background colors of the lines that represent them. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--trace-graph.c48
1 files changed, 44 insertions, 4 deletions
diff --git a/trace-graph.c b/trace-graph.c
index 98cf9fc..c99d167 100644
--- a/trace-graph.c
+++ b/trace-graph.c
@@ -2389,6 +2389,7 @@ trace_graph_create_with_callbacks(struct tracecmd_input *handle,
2389 GtkWidget *label; 2389 GtkWidget *label;
2390 GtkWidget *eventbox; 2390 GtkWidget *eventbox;
2391 GdkColor color; 2391 GdkColor color;
2392 GdkColor colorAB;
2392 2393
2393 ginfo = g_new0(typeof(*ginfo), 1); 2394 ginfo = g_new0(typeof(*ginfo), 1);
2394 g_assert(ginfo != NULL); 2395 g_assert(ginfo != NULL);
@@ -2452,10 +2453,29 @@ trace_graph_create_with_callbacks(struct tracecmd_input *handle,
2452 2453
2453 /* --- Marker A --- */ 2454 /* --- Marker A --- */
2454 2455
2455 label = gtk_label_new("Marker A:"); 2456 hbox = gtk_hbox_new(FALSE, 0);
2456 gtk_table_attach(GTK_TABLE(table), label, 9, 10, 0, 1, GTK_EXPAND, GTK_EXPAND, 3, 3); 2457 gtk_widget_show(hbox);
2458
2459 label = gtk_label_new("Marker");
2460 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
2461 gtk_widget_show(label);
2462
2463 label = gtk_label_new("A:");
2464
2465 colorAB.red = 0;
2466 colorAB.green = (0xff) *(65535/255);
2467 colorAB.blue = 0;
2468
2469 eventbox = gtk_event_box_new();
2470 gtk_widget_show(eventbox);
2471 gtk_widget_modify_bg(eventbox, GTK_STATE_NORMAL, &colorAB);
2472 gtk_container_add(GTK_CONTAINER(eventbox), label);
2473
2474 gtk_box_pack_start(GTK_BOX(hbox), eventbox, FALSE, FALSE, 0);
2457 gtk_widget_show(label); 2475 gtk_widget_show(label);
2458 2476
2477 gtk_table_attach(GTK_TABLE(table), hbox, 9, 10, 0, 1, GTK_EXPAND, GTK_EXPAND, 3, 3);
2478
2459 ginfo->marka_label = gtk_label_new("0.0"); 2479 ginfo->marka_label = gtk_label_new("0.0");
2460 eventbox = gtk_event_box_new(); 2480 eventbox = gtk_event_box_new();
2461 gtk_widget_show(eventbox); 2481 gtk_widget_show(eventbox);
@@ -2468,8 +2488,28 @@ trace_graph_create_with_callbacks(struct tracecmd_input *handle,
2468 2488
2469 /* --- Marker B --- */ 2489 /* --- Marker B --- */
2470 2490
2471 label = gtk_label_new("Marker B:"); 2491 hbox = gtk_hbox_new(FALSE, 0);
2472 gtk_table_attach(GTK_TABLE(table), label, 14, 15, 0, 1, GTK_EXPAND, GTK_EXPAND, 3, 3); 2492 gtk_widget_show(hbox);
2493
2494 label = gtk_label_new("Marker");
2495 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
2496 gtk_widget_show(label);
2497
2498 label = gtk_label_new("B:");
2499
2500 colorAB.red = (0xff) *(65535/255);
2501 colorAB.green = 0;
2502 colorAB.blue = 0;
2503
2504 eventbox = gtk_event_box_new();
2505 gtk_widget_show(eventbox);
2506 gtk_widget_modify_bg(eventbox, GTK_STATE_NORMAL, &colorAB);
2507 gtk_container_add(GTK_CONTAINER(eventbox), label);
2508
2509 gtk_box_pack_start(GTK_BOX(hbox), eventbox, FALSE, FALSE, 0);
2510 gtk_widget_show(label);
2511
2512 gtk_table_attach(GTK_TABLE(table), hbox, 14, 15, 0, 1, GTK_EXPAND, GTK_EXPAND, 3, 3);
2473 gtk_widget_show(label); 2513 gtk_widget_show(label);
2474 2514
2475 ginfo->markb_label = gtk_label_new("0.0"); 2515 ginfo->markb_label = gtk_label_new("0.0");