From 4ec9774d101cd724aba8aec9cf0a8b2f4d0bf088 Mon Sep 17 00:00:00 2001 From: Wolfgang Ulbrich Date: Wed, 3 Feb 2016 16:42:28 +0100 Subject: Changed graph grid line colors based inspired from: https://git.gnome.org/browse/gnome-system-monitor/commit/?id=cb54374 --- src/load-graph.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/load-graph.cpp b/src/load-graph.cpp index 6119849..56aa0fa 100644 --- a/src/load-graph.cpp +++ b/src/load-graph.cpp @@ -67,7 +67,6 @@ unsigned LoadGraph::num_bars() const #define FRAME_WIDTH 4 static void draw_background(LoadGraph *graph) { GtkAllocation allocation; - double dash[2] = { 1.0, 2.0 }; cairo_t *cr; guint i; unsigned num_bars; @@ -112,7 +111,7 @@ static void draw_background(LoadGraph *graph) { cairo_fill(cr); cairo_set_line_width (cr, 1.0); - cairo_set_dash (cr, dash, 2, 0); + cairo_set_source_rgba (cr, 0.89, 0.89, 0.89, 1.0); for (i = 0; i <= num_bars; ++i) { double y; @@ -143,19 +142,23 @@ static void draw_background(LoadGraph *graph) { g_free (caption); } - cairo_set_source_rgba (cr, 0, 0, 0, 0.75); + if (i==0 || i==num_bars) + cairo_set_source_rgba (cr, 0.70, 0.71, 0.70, 1.0); + else + cairo_set_source_rgba (cr, 0.89, 0.89, 0.89, 1.0); cairo_move_to (cr, graph->rmargin + graph->indent - 3, i * graph->graph_dely + 0.5); cairo_line_to (cr, graph->draw_width - 0.5, i * graph->graph_dely + 0.5); + cairo_stroke (cr); } - cairo_stroke (cr); - - cairo_set_dash (cr, dash, 2, 1.5); const unsigned total_seconds = graph->speed * (LoadGraph::NUM_POINTS - 2) / 1000; for (unsigned int i = 0; i < 7; i++) { double x = (i) * (graph->draw_width - graph->rmargin - graph->indent) / 6; - cairo_set_source_rgba (cr, 0, 0, 0, 0.75); + if (i==0 || i==6) + cairo_set_source_rgba (cr, 0.70, 0.71, 0.70, 1.0); + else + cairo_set_source_rgba (cr, 0.89, 0.89, 0.89, 1.0); cairo_move_to (cr, (ceil(x) + 0.5) + graph->rmargin + graph->indent, 0.5); cairo_line_to (cr, (ceil(x) + 0.5) + graph->rmargin + graph->indent, graph->real_draw_height + 4.5); cairo_stroke(cr); -- cgit v1.2.1