From 31c2b2eec7aee4e95da2b4b14f15b3cb0313fb34 Mon Sep 17 00:00:00 2001 From: Jim Evins Date: Thu, 16 Feb 2006 01:45:35 +0000 Subject: [PATCH] 2006-02-15 Jim Evins * 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 | 8 +++++ glabels2/src/label-object.c | 4 +-- glabels2/src/view-box.c | 66 ++----------------------------------- 3 files changed, 13 insertions(+), 65 deletions(-) diff --git a/glabels2/ChangeLog b/glabels2/ChangeLog index 1ed85ecb..eb8d7278 100644 --- a/glabels2/ChangeLog +++ b/glabels2/ChangeLog @@ -1,3 +1,11 @@ +2006-02-15 Jim Evins + + * 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 * data/glade/object-editor.glade: diff --git a/glabels2/src/label-object.c b/glabels2/src/label-object.c index f091213a..b1bdec06 100644 --- a/glabels2/src/label-object.c +++ b/glabels2/src/label-object.c @@ -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) /*========================================================*/ diff --git a/glabels2/src/view-box.c b/glabels2/src/view-box.c index 846ee2de..46a9a7b6 100644 --- a/glabels2/src/view-box.c +++ b/glabels2/src/view-box.c @@ -3,7 +3,7 @@ * * view_box.c: GLabels label box object widget * - * Copyright (C) 2001-2003 Jim Evins . + * Copyright (C) 2001-2006 Jim Evins . * * 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); -- 2.39.5