[gnome-boxes] Make MiniGraphs look like mockup



commit 2471e6ab30b31c6a8afe680cf604812552df00e5
Author: Alexander Larsson <alexl redhat com>
Date:   Fri Jun 8 15:53:00 2012 +0200

    Make MiniGraphs look like mockup
    
    Use the right colors and line widht. Stroke after fill.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=677713

 data/gtk-style.css  |    6 ++++++
 src/mini-graph.vala |   17 ++++++++---------
 2 files changed, 14 insertions(+), 9 deletions(-)
---
diff --git a/data/gtk-style.css b/data/gtk-style.css
index 4b85579..8659edc 100644
--- a/data/gtk-style.css
+++ b/data/gtk-style.css
@@ -17,6 +17,12 @@
     -GtkWidget-separator-height: 1;
 }
 
+BoxesMiniGraph {
+    background-color: #1d1d1d;
+    border-color: #e9e9e9;
+    color: #393939;
+}
+
 .sidebar GtkTreeView:selected {
     background-color: @boxes_selected_color;
     border-width: 2px 8px 2px 0;
diff --git a/src/mini-graph.vala b/src/mini-graph.vala
index 275dbc6..9ac1618 100644
--- a/src/mini-graph.vala
+++ b/src/mini-graph.vala
@@ -52,9 +52,6 @@ private class Boxes.MiniGraph: Gtk.DrawingArea {
         cr.rectangle (0, 0, width, height);
         cr.fill ();
 
-        Gdk.cairo_set_source_rgba (cr, style.get_color (Gtk.StateFlags.NORMAL));
-        cr.set_line_width (1.5);
-
         var nstep = (npoints == -1 ? points.length : npoints) - 1;
         var ymax = ymax_set ? ymax : max ();
         var dy = 0.0;
@@ -64,31 +61,33 @@ private class Boxes.MiniGraph: Gtk.DrawingArea {
         if (ymax != 0)
             dy = (double)height / ymax;
 
+        Gdk.cairo_set_source_rgba (cr, style.get_color (Gtk.StateFlags.NORMAL));
         var x = 0.0;
         foreach (var p in points) {
             var y = height - p * dy;
-
             if (x == 0.0)
                 cr.move_to (x, y);
             else
                 cr.line_to (x, y);
             x += dx;
         }
-        cr.stroke ();
+        cr.line_to (x - dx, height);
+        cr.line_to (0, height);
+        cr.fill ();
 
         Gdk.cairo_set_source_rgba (cr, style.get_border_color (get_state_flags ()));
-        x = 0.0;
+        cr.set_line_width (1.0);
+		x = 0.0;
         foreach (var p in points) {
             var y = height - p * dy;
+
             if (x == 0.0)
                 cr.move_to (x, y);
             else
                 cr.line_to (x, y);
             x += dx;
         }
-        cr.line_to (x - dx, height);
-        cr.line_to (0, height);
-        cr.fill ();
+        cr.stroke ();
 
         return true;
     }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]