]> git.sur5r.net Git - glabels/commitdiff
2004-01-03 Jim Evins <evins@snaught.com>
authorJim Evins <evins@snaught.com>
Sat, 3 Jan 2004 20:50:54 +0000 (20:50 +0000)
committerJim Evins <evins@snaught.com>
Sat, 3 Jan 2004 20:50:54 +0000 (20:50 +0000)
* pixmaps/ex-rect-size.png:
* pixmaps/ex-round-size.png:
* pixmaps/ex-cd-size.png:
* pixmaps/Makefile.am:
Added ex-rect-size.png, ex-round-size.png, and ex-cd-size.png image
files to be used as illustrations/examples in the template-designer.

* src/template-designer.c: (construct_rect_size_page),
(construct_round_size_page), (construct_cd_size_page),
(construct_nlayouts_page), (rect_size_page_prepare_cb),
(round_size_page_prepare_cb), (cd_size_page_prepare_cb),
(layout_page_prepare_cb), (build_template):
* src/template-designer.glade:
Added illustrations for rectangle, round, and cd label size pages.
Added margin spinboxes to these pages, and now add a margin markup
to the constructed template.  Added realistic default values for
some of the size spinboxes.  Cleaned up the code for setting spinbox
ranges on the layouts page.

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

glabels2/ChangeLog
glabels2/pixmaps/Makefile.am
glabels2/pixmaps/ex-cd-size.png [new file with mode: 0644]
glabels2/pixmaps/ex-rect-size.png [new file with mode: 0644]
glabels2/pixmaps/ex-round-size.png [new file with mode: 0644]
glabels2/src/template-designer.c
glabels2/src/template-designer.glade

index 502236a4d3bb6c09f349dcd18c8aaf3d60cf34e8..580925514b5ecfa727ef7d3a2ad00610cb03496d 100644 (file)
@@ -1,3 +1,24 @@
+2004-01-03  Jim Evins  <evins@snaught.com>
+
+       * pixmaps/ex-rect-size.png:
+       * pixmaps/ex-round-size.png:
+       * pixmaps/ex-cd-size.png:
+       * pixmaps/Makefile.am:
+               Added ex-rect-size.png, ex-round-size.png, and ex-cd-size.png image
+               files to be used as illustrations/examples in the template-designer.
+
+       * src/template-designer.c: (construct_rect_size_page),
+       (construct_round_size_page), (construct_cd_size_page),
+       (construct_nlayouts_page), (rect_size_page_prepare_cb),
+       (round_size_page_prepare_cb), (cd_size_page_prepare_cb),
+       (layout_page_prepare_cb), (build_template):
+       * src/template-designer.glade:
+               Added illustrations for rectangle, round, and cd label size pages.
+               Added margin spinboxes to these pages, and now add a margin markup
+               to the constructed template.  Added realistic default values for
+               some of the size spinboxes.  Cleaned up the code for setting spinbox
+               ranges on the layouts page.
+
 2004-01-02  Jim Evins  <evins@snaught.com>
 
        * src/object-editor-size-page.c: (h_spin_cb):
index f337e7b42cc6c91cc9d1991a7be3ef9032d0af2c..f501ed32a160acca351e5adad418cdb8eeb3bc49 100644 (file)
@@ -6,8 +6,11 @@ glabels_pixmaps_DATA = \
        glabels-icon.png        \
        glabels-logo.png        \
        glabels-about-logo.png  \
+       ex-rect-size.png        \
+       ex-round-size.png       \
+       ex-cd-size.png          \
        ex-1layout.png          \
-       ex-2layouts.png
+       ex-2layouts.png         
 
 glabels_mime_icondir = $(datadir)/pixmaps
 
diff --git a/glabels2/pixmaps/ex-cd-size.png b/glabels2/pixmaps/ex-cd-size.png
new file mode 100644 (file)
index 0000000..68261f0
Binary files /dev/null and b/glabels2/pixmaps/ex-cd-size.png differ
diff --git a/glabels2/pixmaps/ex-rect-size.png b/glabels2/pixmaps/ex-rect-size.png
new file mode 100644 (file)
index 0000000..a6d7af9
Binary files /dev/null and b/glabels2/pixmaps/ex-rect-size.png differ
diff --git a/glabels2/pixmaps/ex-round-size.png b/glabels2/pixmaps/ex-round-size.png
new file mode 100644 (file)
index 0000000..c45d6c3
Binary files /dev/null and b/glabels2/pixmaps/ex-round-size.png differ
index 24baf57596cad13388c82a3708ee6f5921780f39..ed4df5ba3d79401c53a32508a7a351ceaee01385 100644 (file)
                                                "glabels/glabels-icon.png",\
                                                FALSE, NULL)
 
-#define EX_1LAYOUT_PIXMAP gnome_program_locate_file (NULL,\
+#define EX_RECT_IMAGE gnome_program_locate_file (NULL,\
+                                               GNOME_FILE_DOMAIN_APP_PIXMAP,\
+                                               "glabels/ex-rect-size.png",\
+                                               FALSE, NULL)
+
+#define EX_ROUND_IMAGE gnome_program_locate_file (NULL,\
+                                               GNOME_FILE_DOMAIN_APP_PIXMAP,\
+                                               "glabels/ex-round-size.png",\
+                                               FALSE, NULL)
+
+#define EX_CD_IMAGE gnome_program_locate_file (NULL,\
+                                               GNOME_FILE_DOMAIN_APP_PIXMAP,\
+                                               "glabels/ex-cd-size.png",\
+                                               FALSE, NULL)
+
+#define EX_NLAYOUTS_IMAGE1 gnome_program_locate_file (NULL,\
                                                GNOME_FILE_DOMAIN_APP_PIXMAP,\
                                                "glabels/ex-1layout.png",\
                                                FALSE, NULL)
 
-#define EX_2LAYOUTS_PIXMAP gnome_program_locate_file (NULL,\
+#define EX_NLAYOUTS_IMAGE2 gnome_program_locate_file (NULL,\
                                                GNOME_FILE_DOMAIN_APP_PIXMAP,\
                                                "glabels/ex-2layouts.png",\
                                                FALSE, NULL)
+
+#define DEFAULT_MARGIN 9.0
+
+#define DEFAULT_RECT_W      252.0
+#define DEFAULT_RECT_H      144.0
+#define DEFAULT_RECT_R        0.0
+#define DEFAULT_RECT_WASTE    0.0 /* Should never exceed 1/2 the distance between items. */
+
+#define DEFAULT_ROUND_R      72.0
+#define DEFAULT_ROUND_WASTE   0.0 /* Should never exceed 1/2 the distance between items. */
+
+#define DEFAULT_CD_RADIUS   166.5
+#define DEFAULT_CD_HOLE      58.5
+#define DEFAULT_CD_WASTE      9.0 /* Should never exceed 1/2 the distance between items. */
+
 #define CONTENTS_BG 0xF5F5F5FF
 #define DELTA 0.01
 #define MAX_PAGE_DIM_POINTS 5000.0
@@ -95,32 +125,41 @@ struct _glTemplateDesignerPrivate
        GtkWidget       *shape_cd_radio;
 
        /* Label size (rectangular) page controls */
+       GtkWidget       *rect_image;
        GtkWidget       *rect_w_spin;
        GtkWidget       *rect_h_spin;
        GtkWidget       *rect_r_spin;
        GtkWidget       *rect_waste_spin;
+       GtkWidget       *rect_margin_spin;
        GtkWidget       *rect_w_units_label;
        GtkWidget       *rect_h_units_label;
        GtkWidget       *rect_r_units_label;
        GtkWidget       *rect_waste_units_label;
+       GtkWidget       *rect_margin_units_label;
 
        /* Label size (round) page controls */
+       GtkWidget       *round_image;
        GtkWidget       *round_r_spin;
        GtkWidget       *round_waste_spin;
+       GtkWidget       *round_margin_spin;
        GtkWidget       *round_r_units_label;
        GtkWidget       *round_waste_units_label;
+       GtkWidget       *round_margin_units_label;
 
        /* Label size (cd) page controls */
+       GtkWidget       *cd_image;
        GtkWidget       *cd_radius_spin;
        GtkWidget       *cd_hole_spin;
        GtkWidget       *cd_w_spin;
        GtkWidget       *cd_h_spin;
        GtkWidget       *cd_waste_spin;
+       GtkWidget       *cd_margin_spin;
        GtkWidget       *cd_radius_units_label;
        GtkWidget       *cd_hole_units_label;
        GtkWidget       *cd_w_units_label;
        GtkWidget       *cd_h_units_label;
        GtkWidget       *cd_waste_units_label;
+       GtkWidget       *cd_margin_units_label;
 
        /* Number of layouts controls */
        GtkWidget       *nlayouts_image1;
@@ -542,10 +581,14 @@ static void
 construct_rect_size_page (glTemplateDesigner      *dlg,
                          GdkPixbuf               *logo)
 {
+       GdkPixbuf *pixbuf;
+
        dlg->priv->rect_size_page =
                glade_xml_get_widget (dlg->priv->gui, "rect_size_page");
 
        /* Rect Size Page Widgets */
+       dlg->priv->rect_image =
+               glade_xml_get_widget (dlg->priv->gui, "rect_image");
        dlg->priv->rect_w_spin =
                glade_xml_get_widget (dlg->priv->gui, "rect_w_spin");
        dlg->priv->rect_h_spin =
@@ -554,6 +597,8 @@ construct_rect_size_page (glTemplateDesigner      *dlg,
                glade_xml_get_widget (dlg->priv->gui, "rect_r_spin");
        dlg->priv->rect_waste_spin =
                glade_xml_get_widget (dlg->priv->gui, "rect_waste_spin");
+       dlg->priv->rect_margin_spin =
+               glade_xml_get_widget (dlg->priv->gui, "rect_margin_spin");
        dlg->priv->rect_w_units_label =
                glade_xml_get_widget (dlg->priv->gui, "rect_w_units_label");
        dlg->priv->rect_h_units_label =
@@ -562,6 +607,12 @@ construct_rect_size_page (glTemplateDesigner      *dlg,
                glade_xml_get_widget (dlg->priv->gui, "rect_r_units_label");
        dlg->priv->rect_waste_units_label =
                glade_xml_get_widget (dlg->priv->gui, "rect_waste_units_label");
+       dlg->priv->rect_margin_units_label =
+               glade_xml_get_widget (dlg->priv->gui, "rect_margin_units_label");
+
+       /* Initialize illustration. */
+       pixbuf = gdk_pixbuf_new_from_file (EX_RECT_IMAGE, NULL);
+       gtk_image_set_from_pixbuf (GTK_IMAGE(dlg->priv->rect_image), pixbuf);
 
        /* Apply units to spinbuttons and units labels. */
         gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dlg->priv->rect_w_spin),
@@ -588,6 +639,24 @@ construct_rect_size_page (glTemplateDesigner      *dlg,
                                         dlg->priv->climb_rate, 10.0*dlg->priv->climb_rate);
         gtk_label_set_text (GTK_LABEL(dlg->priv->rect_waste_units_label),
                            dlg->priv->units_string);
+        gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dlg->priv->rect_margin_spin),
+                                   dlg->priv->digits);
+        gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dlg->priv->rect_margin_spin),
+                                        dlg->priv->climb_rate, 10.0*dlg->priv->climb_rate);
+        gtk_label_set_text (GTK_LABEL(dlg->priv->rect_margin_units_label),
+                           dlg->priv->units_string);
+
+       /* Load some realistic defaults. */
+       gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->rect_w_spin),
+                                  DEFAULT_RECT_W * dlg->priv->units_per_point);
+       gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->rect_h_spin),
+                                  DEFAULT_RECT_H * dlg->priv->units_per_point);
+       gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->rect_r_spin),
+                                  DEFAULT_RECT_R * dlg->priv->units_per_point);
+       gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->rect_waste_spin),
+                                  DEFAULT_RECT_WASTE * dlg->priv->units_per_point);
+       gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->rect_margin_spin),
+                                  DEFAULT_MARGIN * dlg->priv->units_per_point);
 
        /* Handler to prepare the page. */
        g_signal_connect_data (G_OBJECT(dlg->priv->rect_size_page), "prepare",
@@ -606,18 +675,30 @@ static void
 construct_round_size_page (glTemplateDesigner      *dlg,
                           GdkPixbuf               *logo)
 {
+       GdkPixbuf *pixbuf;
+
        dlg->priv->round_size_page =
                glade_xml_get_widget (dlg->priv->gui, "round_size_page");
 
        /* Round Size Page Widgets */
+       dlg->priv->round_image =
+               glade_xml_get_widget (dlg->priv->gui, "round_image");
        dlg->priv->round_r_spin =
                glade_xml_get_widget (dlg->priv->gui, "round_r_spin");
        dlg->priv->round_waste_spin =
                glade_xml_get_widget (dlg->priv->gui, "round_waste_spin");
+       dlg->priv->round_margin_spin =
+               glade_xml_get_widget (dlg->priv->gui, "round_margin_spin");
        dlg->priv->round_r_units_label =
                glade_xml_get_widget (dlg->priv->gui, "round_r_units_label");
        dlg->priv->round_waste_units_label =
                glade_xml_get_widget (dlg->priv->gui, "round_waste_units_label");
+       dlg->priv->round_margin_units_label =
+               glade_xml_get_widget (dlg->priv->gui, "round_margin_units_label");
+
+       /* Initialize illustration. */
+       pixbuf = gdk_pixbuf_new_from_file (EX_ROUND_IMAGE, NULL);
+       gtk_image_set_from_pixbuf (GTK_IMAGE(dlg->priv->round_image), pixbuf);
 
        /* Apply units to spinbuttons and units labels. */
         gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dlg->priv->round_r_spin),
@@ -632,6 +713,20 @@ construct_round_size_page (glTemplateDesigner      *dlg,
                                         dlg->priv->climb_rate, 10.0*dlg->priv->climb_rate);
         gtk_label_set_text (GTK_LABEL(dlg->priv->round_waste_units_label),
                            dlg->priv->units_string);
+        gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dlg->priv->round_margin_spin),
+                                   dlg->priv->digits);
+        gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dlg->priv->round_margin_spin),
+                                        dlg->priv->climb_rate, 10.0*dlg->priv->climb_rate);
+        gtk_label_set_text (GTK_LABEL(dlg->priv->round_margin_units_label),
+                           dlg->priv->units_string);
+
+       /* Load some realistic defaults. */
+       gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->round_r_spin),
+                                  DEFAULT_ROUND_R * dlg->priv->units_per_point);
+       gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->round_waste_spin),
+                                  DEFAULT_ROUND_WASTE * dlg->priv->units_per_point);
+       gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->round_margin_spin),
+                                  DEFAULT_MARGIN * dlg->priv->units_per_point);
 
        /* Handler to prepare the page. */
        g_signal_connect_data (G_OBJECT(dlg->priv->round_size_page), "prepare",
@@ -650,10 +745,14 @@ static void
 construct_cd_size_page (glTemplateDesigner      *dlg,
                        GdkPixbuf               *logo)
 {
+       GdkPixbuf *pixbuf;
+
        dlg->priv->cd_size_page =
                glade_xml_get_widget (dlg->priv->gui, "cd_size_page");
 
        /* Cd Size Page Widgets */
+       dlg->priv->cd_image =
+               glade_xml_get_widget (dlg->priv->gui, "cd_image");
        dlg->priv->cd_radius_spin =
                glade_xml_get_widget (dlg->priv->gui, "cd_radius_spin");
        dlg->priv->cd_hole_spin =
@@ -664,6 +763,8 @@ construct_cd_size_page (glTemplateDesigner      *dlg,
                glade_xml_get_widget (dlg->priv->gui, "cd_h_spin");
        dlg->priv->cd_waste_spin =
                glade_xml_get_widget (dlg->priv->gui, "cd_waste_spin");
+       dlg->priv->cd_margin_spin =
+               glade_xml_get_widget (dlg->priv->gui, "cd_margin_spin");
        dlg->priv->cd_radius_units_label =
                glade_xml_get_widget (dlg->priv->gui, "cd_radius_units_label");
        dlg->priv->cd_hole_units_label =
@@ -674,6 +775,12 @@ construct_cd_size_page (glTemplateDesigner      *dlg,
                glade_xml_get_widget (dlg->priv->gui, "cd_h_units_label");
        dlg->priv->cd_waste_units_label =
                glade_xml_get_widget (dlg->priv->gui, "cd_waste_units_label");
+       dlg->priv->cd_margin_units_label =
+               glade_xml_get_widget (dlg->priv->gui, "cd_margin_units_label");
+
+       /* Initialize illustration. */
+       pixbuf = gdk_pixbuf_new_from_file (EX_CD_IMAGE, NULL);
+       gtk_image_set_from_pixbuf (GTK_IMAGE(dlg->priv->cd_image), pixbuf);
 
        /* Apply units to spinbuttons and units labels. */
         gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dlg->priv->cd_radius_spin),
@@ -706,6 +813,22 @@ construct_cd_size_page (glTemplateDesigner      *dlg,
                                         dlg->priv->climb_rate, 10.0*dlg->priv->climb_rate);
         gtk_label_set_text (GTK_LABEL(dlg->priv->cd_waste_units_label),
                            dlg->priv->units_string);
+        gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dlg->priv->cd_margin_spin),
+                                   dlg->priv->digits);
+        gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dlg->priv->cd_margin_spin),
+                                        dlg->priv->climb_rate, 10.0*dlg->priv->climb_rate);
+        gtk_label_set_text (GTK_LABEL(dlg->priv->cd_margin_units_label),
+                           dlg->priv->units_string);
+
+       /* Load some realistic defaults. */
+       gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->cd_radius_spin),
+                                  DEFAULT_CD_RADIUS * dlg->priv->units_per_point);
+       gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->cd_hole_spin),
+                                  DEFAULT_CD_HOLE * dlg->priv->units_per_point);
+       gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->cd_waste_spin),
+                                  DEFAULT_CD_WASTE * dlg->priv->units_per_point);
+       gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->cd_margin_spin),
+                                  DEFAULT_MARGIN * dlg->priv->units_per_point);
 
        /* Handler to prepare the page. */
        g_signal_connect_data (G_OBJECT(dlg->priv->cd_size_page), "prepare",
@@ -738,9 +861,9 @@ construct_nlayouts_page (glTemplateDesigner      *dlg,
                glade_xml_get_widget (dlg->priv->gui, "nlayouts_spin");
 
        /* Initialize illustrations. */
-       pixbuf = gdk_pixbuf_new_from_file (EX_1LAYOUT_PIXMAP, NULL);
+       pixbuf = gdk_pixbuf_new_from_file (EX_NLAYOUTS_IMAGE1, NULL);
        gtk_image_set_from_pixbuf (GTK_IMAGE(dlg->priv->nlayouts_image1), pixbuf);
-       pixbuf = gdk_pixbuf_new_from_file (EX_2LAYOUTS_PIXMAP, NULL);
+       pixbuf = gdk_pixbuf_new_from_file (EX_NLAYOUTS_IMAGE2, NULL);
        gtk_image_set_from_pixbuf (GTK_IMAGE(dlg->priv->nlayouts_image2), pixbuf);
 
        construct_page_boilerplate (dlg,
@@ -1028,7 +1151,7 @@ static void
 rect_size_page_prepare_cb (glTemplateDesigner *dlg)
 {
        gdouble max_w, max_h;
-       gdouble w, h, r, waste;
+       gdouble w, h, r, waste, margin;
 
        /* Limit label size based on already chosen page size. */
        max_w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->pg_w_spin));
@@ -1037,7 +1160,8 @@ rect_size_page_prepare_cb (glTemplateDesigner *dlg)
        w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_w_spin));
        h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_h_spin));
        r = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_r_spin));
-       waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_waste_spin));
+       waste  = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_waste_spin));
+       margin = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_margin_spin));
 
        gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->rect_w_spin),
                                    dlg->priv->climb_rate, max_w);
@@ -1046,12 +1170,15 @@ rect_size_page_prepare_cb (glTemplateDesigner *dlg)
        gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->rect_r_spin),
                                    0.0, MIN(max_w, max_h)/2.0);
        gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->rect_waste_spin),
-                                   0.0, MIN(max_w, max_h)/2.0);
+                                   0.0, MIN(max_w, max_h)/4.0);
+       gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->rect_margin_spin),
+                                   0.0, MIN(max_w, max_h)/4.0);
 
        gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->rect_w_spin), w);
        gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->rect_h_spin), h);
        gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->rect_r_spin), r);
        gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->rect_waste_spin), waste);
+       gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->rect_margin_spin), margin);
 
 }
 
@@ -1062,22 +1189,26 @@ static void
 round_size_page_prepare_cb (glTemplateDesigner *dlg)
 {
        gdouble max_w, max_h;
-       gdouble r, waste;
+       gdouble r, waste, margin;
 
        /* Limit label size based on already chosen page size. */
        max_w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->pg_w_spin));
        max_h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->pg_h_spin));
 
        r = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->round_r_spin));
-       waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->round_waste_spin));
+       waste  = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->round_waste_spin));
+       margin = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->round_margin_spin));
 
        gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->round_r_spin),
                                    dlg->priv->climb_rate, MIN(max_w, max_h)/2.0);
        gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->round_waste_spin),
-                                   0.0, MIN(max_w, max_h)/2.0);
+                                   0.0, MIN(max_w, max_h)/4.0);
+       gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->round_margin_spin),
+                                   0.0, MIN(max_w, max_h)/4.0);
 
        gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->round_r_spin), r);
        gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->round_waste_spin), waste);
+       gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->round_margin_spin), margin);
 
 }
 
@@ -1088,7 +1219,7 @@ static void
 cd_size_page_prepare_cb (glTemplateDesigner *dlg)
 {
        gdouble max_w, max_h;
-       gdouble radius, hole, w, h, waste;
+       gdouble radius, hole, w, h, waste, margin;
 
        /* Limit label size based on already chosen page size. */
        max_w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->pg_w_spin));
@@ -1098,7 +1229,8 @@ cd_size_page_prepare_cb (glTemplateDesigner *dlg)
        hole = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->cd_hole_spin));
        w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->cd_w_spin));
        h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->cd_h_spin));
-       waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->cd_waste_spin));
+       waste  = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->cd_waste_spin));
+       margin = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->cd_margin_spin));
 
        gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->cd_radius_spin),
                                    dlg->priv->climb_rate, MIN(max_w, max_h)/2.0);
@@ -1109,13 +1241,16 @@ cd_size_page_prepare_cb (glTemplateDesigner *dlg)
        gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->cd_h_spin),
                                    0.0, max_h);
        gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->cd_waste_spin),
-                                   0.0, MIN(max_w, max_h)/2.0);
+                                   0.0, MIN(max_w, max_h)/4.0);
+       gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->cd_margin_spin),
+                                   0.0, MIN(max_w, max_h)/4.0);
 
        gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->cd_radius_spin), radius);
        gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->cd_hole_spin), hole);
        gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->cd_w_spin), w);
        gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->cd_h_spin), h);
        gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->cd_waste_spin), waste);
+       gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->cd_margin_spin), margin);
 
 }
 
@@ -1125,8 +1260,8 @@ cd_size_page_prepare_cb (glTemplateDesigner *dlg)
 static void
 layout_page_prepare_cb (glTemplateDesigner *dlg)
 {
-       gdouble min_x, min_y;
-       gdouble max_x, max_y;
+       gdouble page_w, page_h;
+       gdouble w, h, waste;
        gint    max_nx, max_ny;
        gint    nlayouts;
        gdouble nx_1, ny_1, x0_1, y0_1, dx_1, dy_1;
@@ -1170,22 +1305,25 @@ layout_page_prepare_cb (glTemplateDesigner *dlg)
                                         G_OBJECT(dlg));
 
        /* Limit ranges based on already chosen page and label sizes. */
+       page_w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->pg_w_spin));
+       page_h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->pg_h_spin));
        if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dlg->priv->shape_rect_radio))) {
-               min_x = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_w_spin));
-               min_y = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_h_spin));
+               w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_w_spin));
+               h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_h_spin));
+               waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_waste_spin));
        }
        if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dlg->priv->shape_round_radio))) {
-               min_x = 2*gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->round_r_spin));
-               min_y = 2*min_x;
+               w = 2*gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->round_r_spin));
+               h = w;
+               waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->round_waste_spin));
        }
        if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dlg->priv->shape_cd_radio))) {
-               min_x = 2*gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->cd_radius_spin));
-               min_y = 2*min_x;
+               w = 2*gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->cd_radius_spin));
+               h = w;
+               waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->cd_waste_spin));
        }
-       max_x = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->pg_w_spin));
-       max_y = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->pg_h_spin));
-       max_nx = MAX (floor (max_x/min_x + DELTA), 1.0);
-       max_ny = MAX (floor (max_y/min_y + DELTA), 1.0);
+       max_nx = MAX (floor (page_w/(w + 2*waste) + DELTA), 1.0);
+       max_ny = MAX (floor (page_h/(h + 2*waste) + DELTA), 1.0);
 
        nx_1 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->layout1_nx_spin));
        ny_1 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->layout1_ny_spin));
@@ -1205,25 +1343,25 @@ layout_page_prepare_cb (glTemplateDesigner *dlg)
        gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->layout1_ny_spin),
                                    1, max_ny);
        gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->layout1_x0_spin),
-                                   0.0, max_x-min_x);
+                                   waste, page_w - w - waste);
        gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->layout1_y0_spin),
-                                   0.0, max_y-min_y);
+                                   waste, page_h - h - waste);
        gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->layout1_dx_spin),
-                                   min_x, max_x);
+                                   w + 2*waste, page_w - w - 2*waste);
        gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->layout1_dy_spin),
-                                   min_y, max_y);
+                                   h + 2*waste, page_h - h - 2*waste);
        gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->layout2_nx_spin),
                                    1, max_nx);
        gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->layout2_ny_spin),
                                    1, max_ny);
        gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->layout2_x0_spin),
-                                   0.0, max_x-min_x);
+                                   waste, page_w - w - waste);
        gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->layout2_y0_spin),
-                                   0.0, max_y-min_y);
+                                   waste, page_h - h - waste);
        gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->layout2_dx_spin),
-                                   min_x, max_x);
+                                   w + 2*waste, page_w - w - 2*waste);
        gtk_spin_button_set_range (GTK_SPIN_BUTTON (dlg->priv->layout2_dy_spin),
-                                   min_y, max_y);
+                                   h + 2*waste, page_h - h - 2*waste);
 
        gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->layout1_nx_spin), nx_1);
        gtk_spin_button_set_value (GTK_SPIN_BUTTON(dlg->priv->layout1_ny_spin), ny_1);
@@ -1368,7 +1506,7 @@ build_template (glTemplateDesigner      *dlg)
        gchar                *page_size_name;
        glPaper              *paper;
        glTemplateLabelStyle  shape;
-       gdouble               w, h, r, radius, hole, waste;
+       gdouble               w, h, r, radius, hole, waste, margin;
        gint                  nlayouts;
        gdouble               nx_1, ny_1, x0_1, y0_1, dx_1, dy_1;
        gdouble               nx_2, ny_2, x0_2, y0_2, dx_2, dy_2;
@@ -1396,12 +1534,14 @@ build_template (glTemplateDesigner      *dlg)
                h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_h_spin));
                r = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_r_spin));
                waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_waste_spin));
+               margin = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->rect_margin_spin));
        }
 
        if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dlg->priv->shape_round_radio))) {
                shape = GL_TEMPLATE_STYLE_ROUND;
                r = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->round_r_spin));
                waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->round_waste_spin));
+               margin = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->round_margin_spin));
        }
 
        if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dlg->priv->shape_cd_radio))) {
@@ -1411,6 +1551,7 @@ build_template (glTemplateDesigner      *dlg)
                w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->cd_w_spin));
                h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->cd_h_spin));
                waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->cd_waste_spin));
+               margin = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dlg->priv->cd_margin_spin));
        }
 
        nlayouts = gtk_spin_button_get_value (GTK_SPIN_BUTTON (dlg->priv->nlayouts_spin));
@@ -1456,6 +1597,9 @@ build_template (glTemplateDesigner      *dlg)
                template->label.cd.waste = waste / dlg->priv->units_per_point;
                break;
        }
+       template->label.any.markups =
+               g_list_append (template->label.any.markups,
+                              gl_template_markup_margin_new (margin / dlg->priv->units_per_point));
        template->label.any.layouts =
                g_list_append (template->label.any.layouts,
                               gl_template_layout_new (nx_1, ny_1,
index 3d085462292df97f7b9a07dc8b811d87359a45e6..f5396b2f0abcf0e985e2b65eed1a0218db8a93e3 100644 (file)
@@ -800,7 +800,7 @@ This dialog will assist you in the creation of a custom gLabels template.</prope
                      <child>
                        <widget class="GtkTable" id="table4">
                          <property name="visible">True</property>
-                         <property name="n_rows">4</property>
+                         <property name="n_rows">5</property>
                          <property name="n_columns">3</property>
                          <property name="homogeneous">False</property>
                          <property name="row_spacing">12</property>
@@ -809,7 +809,7 @@ This dialog will assist you in the creation of a custom gLabels template.</prope
                          <child>
                            <widget class="GtkLabel" id="label83">
                              <property name="visible">True</property>
-                             <property name="label" translatable="yes">Width:</property>
+                             <property name="label" translatable="yes">1. Width:</property>
                              <property name="use_underline">False</property>
                              <property name="use_markup">False</property>
                              <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -833,7 +833,7 @@ This dialog will assist you in the creation of a custom gLabels template.</prope
                          <child>
                            <widget class="GtkLabel" id="label84">
                              <property name="visible">True</property>
-                             <property name="label" translatable="yes">Height:</property>
+                             <property name="label" translatable="yes">2. Height:</property>
                              <property name="use_underline">False</property>
                              <property name="use_markup">False</property>
                              <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -857,7 +857,7 @@ This dialog will assist you in the creation of a custom gLabels template.</prope
                          <child>
                            <widget class="GtkLabel" id="label85">
                              <property name="visible">True</property>
-                             <property name="label" translatable="yes">Round (radius of corner):</property>
+                             <property name="label" translatable="yes">3. Round (radius of corner):</property>
                              <property name="use_underline">False</property>
                              <property name="use_markup">False</property>
                              <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -881,7 +881,7 @@ This dialog will assist you in the creation of a custom gLabels template.</prope
                          <child>
                            <widget class="GtkLabel" id="label86">
                              <property name="visible">True</property>
-                             <property name="label" translatable="yes">Waste (overprint allowed):</property>
+                             <property name="label" translatable="yes">4. Waste (overprint allowed):</property>
                              <property name="use_underline">False</property>
                              <property name="use_markup">False</property>
                              <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -1081,6 +1081,75 @@ This dialog will assist you in the creation of a custom gLabels template.</prope
                              <property name="y_options"></property>
                            </packing>
                          </child>
+
+                         <child>
+                           <widget class="GtkLabel" id="label101">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">5. Margin</property>
+                             <property name="use_underline">False</property>
+                             <property name="use_markup">False</property>
+                             <property name="justify">GTK_JUSTIFY_LEFT</property>
+                             <property name="wrap">False</property>
+                             <property name="selectable">False</property>
+                             <property name="xalign">0</property>
+                             <property name="yalign">0.5</property>
+                             <property name="xpad">0</property>
+                             <property name="ypad">0</property>
+                           </widget>
+                           <packing>
+                             <property name="left_attach">0</property>
+                             <property name="right_attach">1</property>
+                             <property name="top_attach">4</property>
+                             <property name="bottom_attach">5</property>
+                             <property name="x_options">fill</property>
+                             <property name="y_options"></property>
+                           </packing>
+                         </child>
+
+                         <child>
+                           <widget class="GtkLabel" id="rect_margin_units_label">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">inches</property>
+                             <property name="use_underline">False</property>
+                             <property name="use_markup">False</property>
+                             <property name="justify">GTK_JUSTIFY_LEFT</property>
+                             <property name="wrap">False</property>
+                             <property name="selectable">False</property>
+                             <property name="xalign">0</property>
+                             <property name="yalign">0.5</property>
+                             <property name="xpad">0</property>
+                             <property name="ypad">0</property>
+                           </widget>
+                           <packing>
+                             <property name="left_attach">2</property>
+                             <property name="right_attach">3</property>
+                             <property name="top_attach">4</property>
+                             <property name="bottom_attach">5</property>
+                             <property name="x_options">fill</property>
+                             <property name="y_options"></property>
+                           </packing>
+                         </child>
+
+                         <child>
+                           <widget class="GtkSpinButton" id="rect_margin_spin">
+                             <property name="visible">True</property>
+                             <property name="can_focus">True</property>
+                             <property name="climb_rate">0.01</property>
+                             <property name="digits">0</property>
+                             <property name="numeric">False</property>
+                             <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+                             <property name="snap_to_ticks">False</property>
+                             <property name="wrap">False</property>
+                             <property name="adjustment">0 0 100 1 10 10</property>
+                           </widget>
+                           <packing>
+                             <property name="left_attach">1</property>
+                             <property name="right_attach">2</property>
+                             <property name="top_attach">4</property>
+                             <property name="bottom_attach">5</property>
+                             <property name="y_options"></property>
+                           </packing>
+                         </child>
                        </widget>
                        <packing>
                          <property name="padding">0</property>
@@ -1170,7 +1239,7 @@ This dialog will assist you in the creation of a custom gLabels template.</prope
                      <child>
                        <widget class="GtkTable" id="table8">
                          <property name="visible">True</property>
-                         <property name="n_rows">2</property>
+                         <property name="n_rows">3</property>
                          <property name="n_columns">3</property>
                          <property name="homogeneous">False</property>
                          <property name="row_spacing">12</property>
@@ -1179,7 +1248,7 @@ This dialog will assist you in the creation of a custom gLabels template.</prope
                          <child>
                            <widget class="GtkLabel" id="label91">
                              <property name="visible">True</property>
-                             <property name="label" translatable="yes">Radius:</property>
+                             <property name="label" translatable="yes">1. Radius:</property>
                              <property name="use_underline">False</property>
                              <property name="use_markup">False</property>
                              <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -1203,7 +1272,7 @@ This dialog will assist you in the creation of a custom gLabels template.</prope
                          <child>
                            <widget class="GtkLabel" id="label92">
                              <property name="visible">True</property>
-                             <property name="label" translatable="yes">Waste (overprint allowed):</property>
+                             <property name="label" translatable="yes">2. Waste (overprint allowed):</property>
                              <property name="use_underline">False</property>
                              <property name="use_markup">False</property>
                              <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -1313,6 +1382,75 @@ This dialog will assist you in the creation of a custom gLabels template.</prope
                              <property name="y_options"></property>
                            </packing>
                          </child>
+
+                         <child>
+                           <widget class="GtkLabel" id="label103">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">3. Margin</property>
+                             <property name="use_underline">False</property>
+                             <property name="use_markup">False</property>
+                             <property name="justify">GTK_JUSTIFY_LEFT</property>
+                             <property name="wrap">False</property>
+                             <property name="selectable">False</property>
+                             <property name="xalign">0</property>
+                             <property name="yalign">0.5</property>
+                             <property name="xpad">0</property>
+                             <property name="ypad">0</property>
+                           </widget>
+                           <packing>
+                             <property name="left_attach">0</property>
+                             <property name="right_attach">1</property>
+                             <property name="top_attach">2</property>
+                             <property name="bottom_attach">3</property>
+                             <property name="x_options">fill</property>
+                             <property name="y_options"></property>
+                           </packing>
+                         </child>
+
+                         <child>
+                           <widget class="GtkLabel" id="round_margin_units_label">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">inches</property>
+                             <property name="use_underline">False</property>
+                             <property name="use_markup">False</property>
+                             <property name="justify">GTK_JUSTIFY_LEFT</property>
+                             <property name="wrap">False</property>
+                             <property name="selectable">False</property>
+                             <property name="xalign">0</property>
+                             <property name="yalign">0.5</property>
+                             <property name="xpad">0</property>
+                             <property name="ypad">0</property>
+                           </widget>
+                           <packing>
+                             <property name="left_attach">2</property>
+                             <property name="right_attach">3</property>
+                             <property name="top_attach">2</property>
+                             <property name="bottom_attach">3</property>
+                             <property name="x_options">fill</property>
+                             <property name="y_options"></property>
+                           </packing>
+                         </child>
+
+                         <child>
+                           <widget class="GtkSpinButton" id="round_margin_spin">
+                             <property name="visible">True</property>
+                             <property name="can_focus">True</property>
+                             <property name="climb_rate">0.01</property>
+                             <property name="digits">0</property>
+                             <property name="numeric">False</property>
+                             <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+                             <property name="snap_to_ticks">False</property>
+                             <property name="wrap">False</property>
+                             <property name="adjustment">0 0 100 1 10 10</property>
+                           </widget>
+                           <packing>
+                             <property name="left_attach">1</property>
+                             <property name="right_attach">2</property>
+                             <property name="top_attach">2</property>
+                             <property name="bottom_attach">3</property>
+                             <property name="y_options"></property>
+                           </packing>
+                         </child>
                        </widget>
                        <packing>
                          <property name="padding">0</property>
@@ -1402,7 +1540,7 @@ This dialog will assist you in the creation of a custom gLabels template.</prope
                      <child>
                        <widget class="GtkTable" id="table7">
                          <property name="visible">True</property>
-                         <property name="n_rows">5</property>
+                         <property name="n_rows">6</property>
                          <property name="n_columns">3</property>
                          <property name="homogeneous">False</property>
                          <property name="row_spacing">12</property>
@@ -1411,7 +1549,7 @@ This dialog will assist you in the creation of a custom gLabels template.</prope
                          <child>
                            <widget class="GtkLabel" id="label95">
                              <property name="visible">True</property>
-                             <property name="label" translatable="yes">Outer radius:</property>
+                             <property name="label" translatable="yes">1. Outer radius:</property>
                              <property name="use_underline">False</property>
                              <property name="use_markup">False</property>
                              <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -1435,7 +1573,7 @@ This dialog will assist you in the creation of a custom gLabels template.</prope
                          <child>
                            <widget class="GtkLabel" id="label96">
                              <property name="visible">True</property>
-                             <property name="label" translatable="yes">Inner radius:</property>
+                             <property name="label" translatable="yes">2. Inner radius:</property>
                              <property name="use_underline">False</property>
                              <property name="use_markup">False</property>
                              <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -1459,7 +1597,7 @@ This dialog will assist you in the creation of a custom gLabels template.</prope
                          <child>
                            <widget class="GtkLabel" id="label97">
                              <property name="visible">True</property>
-                             <property name="label" translatable="yes">Clipping width:</property>
+                             <property name="label" translatable="yes">3. Clipping width:</property>
                              <property name="use_underline">False</property>
                              <property name="use_markup">False</property>
                              <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -1483,7 +1621,7 @@ This dialog will assist you in the creation of a custom gLabels template.</prope
                          <child>
                            <widget class="GtkLabel" id="label98">
                              <property name="visible">True</property>
-                             <property name="label" translatable="yes">Clipping height:</property>
+                             <property name="label" translatable="yes">4. Clipping height:</property>
                              <property name="use_underline">False</property>
                              <property name="use_markup">False</property>
                              <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -1507,7 +1645,7 @@ This dialog will assist you in the creation of a custom gLabels template.</prope
                          <child>
                            <widget class="GtkLabel" id="label99">
                              <property name="visible">True</property>
-                             <property name="label" translatable="yes">Waste (overprint allowed):</property>
+                             <property name="label" translatable="yes">5. Waste (overprint allowed):</property>
                              <property name="use_underline">False</property>
                              <property name="use_markup">False</property>
                              <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -1642,7 +1780,7 @@ This dialog will assist you in the creation of a custom gLabels template.</prope
                              <property name="justify">GTK_JUSTIFY_LEFT</property>
                              <property name="wrap">False</property>
                              <property name="selectable">False</property>
-                             <property name="xalign">0.5</property>
+                             <property name="xalign">0</property>
                              <property name="yalign">0.5</property>
                              <property name="xpad">0</property>
                              <property name="ypad">0</property>
@@ -1666,7 +1804,7 @@ This dialog will assist you in the creation of a custom gLabels template.</prope
                              <property name="justify">GTK_JUSTIFY_LEFT</property>
                              <property name="wrap">False</property>
                              <property name="selectable">False</property>
-                             <property name="xalign">0.5</property>
+                             <property name="xalign">0</property>
                              <property name="yalign">0.5</property>
                              <property name="xpad">0</property>
                              <property name="ypad">0</property>
@@ -1690,7 +1828,7 @@ This dialog will assist you in the creation of a custom gLabels template.</prope
                              <property name="justify">GTK_JUSTIFY_LEFT</property>
                              <property name="wrap">False</property>
                              <property name="selectable">False</property>
-                             <property name="xalign">0.5</property>
+                             <property name="xalign">0</property>
                              <property name="yalign">0.5</property>
                              <property name="xpad">0</property>
                              <property name="ypad">0</property>
@@ -1714,7 +1852,7 @@ This dialog will assist you in the creation of a custom gLabels template.</prope
                              <property name="justify">GTK_JUSTIFY_LEFT</property>
                              <property name="wrap">False</property>
                              <property name="selectable">False</property>
-                             <property name="xalign">0.5</property>
+                             <property name="xalign">0</property>
                              <property name="yalign">0.5</property>
                              <property name="xpad">0</property>
                              <property name="ypad">0</property>
@@ -1738,7 +1876,7 @@ This dialog will assist you in the creation of a custom gLabels template.</prope
                              <property name="justify">GTK_JUSTIFY_LEFT</property>
                              <property name="wrap">False</property>
                              <property name="selectable">False</property>
-                             <property name="xalign">0.5</property>
+                             <property name="xalign">0</property>
                              <property name="yalign">0.5</property>
                              <property name="xpad">0</property>
                              <property name="ypad">0</property>
@@ -1752,6 +1890,75 @@ This dialog will assist you in the creation of a custom gLabels template.</prope
                              <property name="y_options"></property>
                            </packing>
                          </child>
+
+                         <child>
+                           <widget class="GtkLabel" id="label105">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">6. Margin</property>
+                             <property name="use_underline">False</property>
+                             <property name="use_markup">False</property>
+                             <property name="justify">GTK_JUSTIFY_LEFT</property>
+                             <property name="wrap">False</property>
+                             <property name="selectable">False</property>
+                             <property name="xalign">0</property>
+                             <property name="yalign">0.5</property>
+                             <property name="xpad">0</property>
+                             <property name="ypad">0</property>
+                           </widget>
+                           <packing>
+                             <property name="left_attach">0</property>
+                             <property name="right_attach">1</property>
+                             <property name="top_attach">5</property>
+                             <property name="bottom_attach">6</property>
+                             <property name="x_options">fill</property>
+                             <property name="y_options"></property>
+                           </packing>
+                         </child>
+
+                         <child>
+                           <widget class="GtkLabel" id="cd_margin_units_label">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">inches</property>
+                             <property name="use_underline">False</property>
+                             <property name="use_markup">False</property>
+                             <property name="justify">GTK_JUSTIFY_LEFT</property>
+                             <property name="wrap">False</property>
+                             <property name="selectable">False</property>
+                             <property name="xalign">0</property>
+                             <property name="yalign">0.5</property>
+                             <property name="xpad">0</property>
+                             <property name="ypad">0</property>
+                           </widget>
+                           <packing>
+                             <property name="left_attach">2</property>
+                             <property name="right_attach">3</property>
+                             <property name="top_attach">5</property>
+                             <property name="bottom_attach">6</property>
+                             <property name="x_options">fill</property>
+                             <property name="y_options"></property>
+                           </packing>
+                         </child>
+
+                         <child>
+                           <widget class="GtkSpinButton" id="cd_margin_spin">
+                             <property name="visible">True</property>
+                             <property name="can_focus">True</property>
+                             <property name="climb_rate">0.01</property>
+                             <property name="digits">0</property>
+                             <property name="numeric">False</property>
+                             <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+                             <property name="snap_to_ticks">False</property>
+                             <property name="wrap">False</property>
+                             <property name="adjustment">0 0 100 1 10 10</property>
+                           </widget>
+                           <packing>
+                             <property name="left_attach">1</property>
+                             <property name="right_attach">2</property>
+                             <property name="top_attach">5</property>
+                             <property name="bottom_attach">6</property>
+                             <property name="y_options"></property>
+                           </packing>
+                         </child>
                        </widget>
                        <packing>
                          <property name="padding">0</property>