From: Jim Evins Date: Sat, 13 Mar 2010 15:49:52 +0000 (-0500) Subject: Some new label dialog cleanup X-Git-Tag: glabels-2_3_0~68 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=84dfd774bae16f8bdc9dde21baabd41cc7638dd0;p=glabels Some new label dialog cleanup Draw arrow in mini preview relative to first label, not the entire sheet. This should be more obvious what the arrow is indicating, before it could have been interpreted as the feed direction. Don't put an empty line at the end of the list of similar templates. --- diff --git a/src/mini-preview.c b/src/mini-preview.c index abbc1046..1d397b32 100644 --- a/src/mini-preview.c +++ b/src/mini-preview.c @@ -41,7 +41,7 @@ #define SHADOW_OFFSET 3 #define ARROW_SCALE 0.35 -#define ARROW_RGBA_ARGS 1.0, 0.0, 0.0, 0.05 +#define ARROW_RGBA_ARGS 1.0, 0.0, 0.0, 0.25 /*===========================================*/ /* Private types */ @@ -145,9 +145,7 @@ static void draw_labels (glMiniPreview *this, lglTemplate *template, gdouble line_width); static void draw_arrow (glMiniPreview *this, - cairo_t *cr, - gdouble width, - gdouble height); + cairo_t *cr); static void draw_rich_preview (glMiniPreview *this, cairo_t *cr); @@ -902,8 +900,7 @@ draw (glMiniPreview *this, if (this->priv->draw_arrow_flag) { - draw_arrow (this, cr, - template->page_width, template->page_height); + draw_arrow (this, cr); } if (this->priv->label) @@ -1058,17 +1055,25 @@ draw_labels (glMiniPreview *this, /*--------------------------------------------------------------------------*/ static void draw_arrow (glMiniPreview *this, - cairo_t *cr, - gdouble width, - gdouble height) + cairo_t *cr) { - gdouble min; + lglTemplateFrame *frame; + lglTemplateOrigin *origins; + gdouble width, height, min; + gdouble x0, y0; - cairo_save (cr); + frame = (lglTemplateFrame *)this->priv->template->frames->data; + lgl_template_frame_get_size (frame, &width, &height); + origins = lgl_template_frame_get_origins (frame); + x0 = origins[0].x; + y0 = origins[0].y; min = MIN (width, height); + g_free (origins); + + cairo_save (cr); - cairo_translate (cr, width/2, height/2); + cairo_translate (cr, x0 + width/2, y0 + height/2); cairo_scale (cr, 1, -1); if ( this->priv->rotate_flag ) { @@ -1076,7 +1081,7 @@ draw_arrow (glMiniPreview *this, } cairo_new_path (cr); - cairo_move_to (cr, 0, -min*ARROW_SCALE/2); + cairo_move_to (cr, 0, -min*ARROW_SCALE); cairo_line_to (cr, 0, min*ARROW_SCALE); cairo_new_sub_path (cr); diff --git a/src/new-label-dialog.c b/src/new-label-dialog.c index ffea6dc0..0cb690c2 100644 --- a/src/new-label-dialog.c +++ b/src/new-label-dialog.c @@ -375,7 +375,11 @@ set_info (glNewLabelDialog *this, list_string = g_string_new (""); for ( p = list; p; p = p->next ) { - g_string_append_printf (list_string, "%s\n", (char *)p->data); + g_string_append (list_string, (char *)p->data); + if ( p->next ) + { + g_string_append (list_string, "\n"); + } } gtk_label_set_text (GTK_LABEL (this->priv->similar_label), list_string->str);