]> git.sur5r.net Git - glabels/commitdiff
Some new label dialog cleanup
authorJim Evins <evins@snaught.com>
Sat, 13 Mar 2010 15:49:52 +0000 (10:49 -0500)
committerJim Evins <evins@snaught.com>
Sat, 13 Mar 2010 15:49:52 +0000 (10:49 -0500)
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.

src/mini-preview.c
src/new-label-dialog.c

index abbc10462a07725c401597f393f528a7e26e833c..1d397b321a1226b9e67b551ff4c490fdfda028c2 100644 (file)
@@ -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);
index ffea6dc06ac33500dac4a7355e71650498987d94..0cb690c22790d9a39b8bae48e3a02acbb532bf16 100644 (file)
@@ -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);