Revision: 1400
          http://geeqie.svn.sourceforge.net/geeqie/?rev=1400&view=rev
Author:   zas_
Date:     2009-02-21 10:53:18 +0000 (Sat, 21 Feb 2009)

Log Message:
-----------
Move grid color setting to histogram_new().

Modified Paths:
--------------
    trunk/src/histogram.c

Modified: trunk/src/histogram.c
===================================================================
--- trunk/src/histogram.c       2009-02-21 10:33:56 UTC (rev 1399)
+++ trunk/src/histogram.c       2009-02-21 10:53:18 UTC (rev 1400)
@@ -39,10 +39,16 @@
 };
 
 struct _Histogram {
-       gint channel_mode;
-       gint log_mode;
+       gint channel_mode; /* drawing mode for histogram */
+       gint log_mode;     /* logarithmical or not */
        guint vgrid; /* number of vertical divisions, 0 for none */
        guint hgrid; /* number of horizontal divisions, 0 for none */
+       struct {
+               int R; /* red */
+               int G; /* green */
+               int B; /* blue */
+               int A; /* alpha */
+       } grid_color;  /* grid color */
 
 };
 
@@ -53,8 +59,14 @@
        histogram = g_new0(Histogram, 1);
        histogram->channel_mode = options->histogram.last_channel_mode;
        histogram->log_mode = options->histogram.last_log_mode;
+
+       /* grid */
        histogram->vgrid = 5;
        histogram->hgrid = 3;
+       histogram->grid_color.R = 160;
+       histogram->grid_color.G = 160;
+       histogram->grid_color.B = 160;
+       histogram->grid_color.A = 250;
 
        return histogram;
 }
@@ -172,8 +184,6 @@
 
 static void histogram_vgrid(Histogram *histogram, GdkPixbuf *pixbuf, gint x, 
gint y, gint width, gint height)
 {
-       static gint c = 160;
-       static gint alpha = 250;
        guint i;
        float add;
        
@@ -185,14 +195,16 @@
                {
                gint xpos = x + (int)(i * add + 0.5);
 
-               pixbuf_draw_line(pixbuf, x, y, width, height, xpos, y, xpos, y 
+ height, c, c, c, alpha);
+               pixbuf_draw_line(pixbuf, x, y, width, height, xpos, y, xpos, y 
+ height,
+                                histogram->grid_color.R,
+                                histogram->grid_color.G,
+                                histogram->grid_color.B,
+                                histogram->grid_color.A);
                }
 }
 
 static void histogram_hgrid(Histogram *histogram, GdkPixbuf *pixbuf, gint x, 
gint y, gint width, gint height)
 {
-       static gint c = 160;
-       static gint alpha = 250;
        guint i;
        float add;
        
@@ -204,7 +216,11 @@
                {
                gint ypos = y + (int)(i * add + 0.5);
        
-               pixbuf_draw_line(pixbuf, x, y, width, height, x, ypos, x + 
width, ypos, c, c, c, alpha);
+               pixbuf_draw_line(pixbuf, x, y, width, height, x, ypos, x + 
width, ypos,
+                                histogram->grid_color.R,
+                                histogram->grid_color.G,
+                                histogram->grid_color.B,
+                                histogram->grid_color.A);
                }
 }
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Geeqie-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geeqie-svn

Reply via email to