]> git.sur5r.net Git - glabels/commitdiff
2006-02-15 Jim Evins <evins@snaught.com>
authorJim Evins <evins@snaught.com>
Thu, 16 Feb 2006 01:45:35 +0000 (01:45 +0000)
committerJim Evins <evins@snaught.com>
Thu, 16 Feb 2006 01:45:35 +0000 (01:45 +0000)
* src/label-object.c:
Changed default shadow offsets.
* src/view-box.c: (gl_view_box_new):
Simplified gl_view_box_new() so that is does not duplicate code
in update_canvas_item_from_object_cb().

git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@584 f5e0f49d-192f-0410-a22d-a8d8700d0965

glabels2/ChangeLog
glabels2/src/label-object.c
glabels2/src/view-box.c

index 1ed85ecb4c509c880d6fa326eaab399efb08efe6..eb8d727843fb276faf0b0c8257443b7c05ae01fb 100644 (file)
@@ -1,3 +1,11 @@
+2006-02-15  Jim Evins  <evins@snaught.com>
+
+       * src/label-object.c:
+               Changed default shadow offsets.
+       * src/view-box.c: (gl_view_box_new):
+               Simplified gl_view_box_new() so that is does not duplicate code
+               in update_canvas_item_from_object_cb().
+
 2006-02-07  Jim Evins  <evins@snaught.com>
 
        * data/glade/object-editor.glade:
index f091213a742d219f545197482a798df6cf64f59c..b1bdec06a486532603a2ef4f1036d11639035aa8 100644 (file)
@@ -37,8 +37,8 @@
 /* Private defines.                                       */
 /*========================================================*/
 
-#define DEFAULT_SHADOW_X_OFFSET (5.0)
-#define DEFAULT_SHADOW_Y_OFFSET (5.0)
+#define DEFAULT_SHADOW_X_OFFSET (3.6)
+#define DEFAULT_SHADOW_Y_OFFSET (3.6)
 #define DEFAULT_SHADOW_OPACITY  (0.5)
 
 /*========================================================*/
index 846ee2de7cc96be3d27af72c74b1de91e331ef37..46a9a7b6c762b5e7a2117237abf9df311cfb869b 100644 (file)
@@ -3,7 +3,7 @@
  *
  *  view_box.c:  GLabels label box object widget
  *
- *  Copyright (C) 2001-2003  Jim Evins <evins@snaught.com>.
+ *  Copyright (C) 2001-2006  Jim Evins <evins@snaught.com>.
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -165,18 +165,9 @@ gl_view_box_new (glLabelBox *object,
                 glView     *view)
 {
        glViewBox         *view_box;
-       gdouble            line_width;
-       glColorNode       *line_color_node;
-       gdouble            w, h;
-       glColorNode       *fill_color_node;
-       gboolean           shadow_state;
-       gdouble            shadow_x, shadow_y;
-       glColorNode       *shadow_color_node;
-       gdouble            shadow_opacity;
-       guint              shadow_line_color;
-       guint              shadow_fill_color;
 
        gl_debug (DEBUG_VIEW, "START");
+
        g_return_if_fail (object && GL_IS_LABEL_BOX (object));
        g_return_if_fail (view && GL_IS_VIEW (view));
        
@@ -187,67 +178,16 @@ gl_view_box_new (glLabelBox *object,
                                   GL_LABEL_OBJECT(object),
                                   GL_VIEW_HIGHLIGHT_BOX_RESIZABLE);
 
-       /* Query properties of object. */
-       gl_label_object_get_size (GL_LABEL_OBJECT(object), &w, &h);
-       line_width = gl_label_object_get_line_width(GL_LABEL_OBJECT(object));
-       line_color_node = gl_label_object_get_line_color(GL_LABEL_OBJECT(object));
-       if (line_color_node->field_flag)
-       {
-               line_color_node->color = GL_COLOR_MERGE_DEFAULT;
-       }
-       fill_color_node = gl_label_object_get_fill_color(GL_LABEL_OBJECT(object));
-       if (fill_color_node->field_flag)
-       {
-               fill_color_node->color = GL_COLOR_FILL_MERGE_DEFAULT;
-       }
-       shadow_state = gl_label_object_get_shadow_state (GL_LABEL_OBJECT (object));
-       gl_label_object_get_shadow_offset (GL_LABEL_OBJECT (object), &shadow_x, &shadow_y);
-       shadow_color_node = gl_label_object_get_shadow_color (GL_LABEL_OBJECT (object));
-       if (shadow_color_node->field_flag)
-       {
-               shadow_color_node->color = GL_COLOR_SHADOW_MERGE_DEFAULT;
-       }
-       shadow_opacity = gl_label_object_get_shadow_opacity (GL_LABEL_OBJECT (object));
-       shadow_line_color = gl_color_shadow (shadow_color_node->color,
-                                            shadow_opacity,
-                                            line_color_node->color);
-       shadow_fill_color = gl_color_shadow (shadow_color_node->color,
-                                            shadow_opacity,
-                                            fill_color_node->color);
-
        /* Create analogous canvas items. */
        view_box->private->shadow_item =
                gl_view_object_item_new (GL_VIEW_OBJECT(view_box),
                                         gnome_canvas_rect_get_type (),
-                                        "x1", shadow_x,
-                                        "y1", shadow_y,
-                                        "x2", shadow_x + w + DELTA,
-                                        "y2", shadow_y + h + DELTA,
-                                        "width_units", line_width,
-                                        "outline_color_rgba", shadow_line_color,
-                                        "fill_color_rgba", shadow_fill_color,
                                         NULL);
-
-       if (!shadow_state)
-       {
-               gnome_canvas_item_hide (view_box->private->shadow_item);
-       }
-
        view_box->private->object_item =
                gl_view_object_item_new (GL_VIEW_OBJECT(view_box),
                                         gnome_canvas_rect_get_type (),
-                                        "x1", 0.0,
-                                        "y1", 0.0,
-                                        "x2", w + DELTA,
-                                        "y2", h + DELTA,
-                                        "width_units", line_width,
-                                        "outline_color_rgba", line_color_node->color,
-                                        "fill_color_rgba", fill_color_node->color,
                                         NULL);
-
-       gl_color_node_free (&line_color_node);
-       gl_color_node_free (&fill_color_node);
-       gl_color_node_free (&shadow_color_node);
+       update_canvas_item_from_object_cb (GL_LABEL_OBJECT(object), view_box);
        
        g_signal_connect (G_OBJECT (object), "changed",
                          G_CALLBACK (update_canvas_item_from_object_cb), view_box);