]> git.sur5r.net Git - glabels/commitdiff
Refinements to new label dialog and associated widgets.
authorJim Evins <evins@snaught.com>
Thu, 19 Sep 2002 02:38:44 +0000 (02:38 +0000)
committerJim Evins <evins@snaught.com>
Thu, 19 Sep 2002 02:38:44 +0000 (02:38 +0000)
git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@124 f5e0f49d-192f-0410-a22d-a8d8700d0965

glabels2/src/hig.h
glabels2/src/wdgt-media-select.c
glabels2/src/wdgt-mini-preview.c
glabels2/src/wdgt-rotate-label.c

index c1d1359d92cd5de46610d20d2bd56601d3c24f4e..1e1a196596fc6cf682384a33e03825b24195c49b 100644 (file)
@@ -27,6 +27,8 @@
 
 G_BEGIN_DECLS
 
+#define GL_HIG_SPACING 6
+
 /*===========================================================================*/
 /* HIG Dialog.                                                               */
 /*===========================================================================*/
index 03d7601588a05c26fa138b2417abbc5d1425f8ed..a212dba972d527c63757a81f4622a736d9122ccf 100644 (file)
@@ -23,6 +23,7 @@
 #include <config.h>
 
 #include "wdgt-media-select.h"
+#include "hig.h"
 #include "template.h"
 #include "wdgt-mini-preview.h"
 #include "prefs.h"
@@ -194,9 +195,10 @@ gl_wdgt_media_select_construct (glWdgtMediaSelect * media_select)
        page_size = gl_prefs_get_page_size ();
 
        wvbox = GTK_WIDGET (media_select);
+       gtk_box_set_spacing (GTK_BOX(wvbox), GL_HIG_SPACING);
 
-       whbox = gtk_hbox_new (FALSE, GNOME_PAD);
-       gtk_box_pack_start (GTK_BOX (wvbox), whbox, TRUE, TRUE, GNOME_PAD);
+       whbox = gtk_hbox_new (FALSE, GL_HIG_SPACING);
+       gtk_box_pack_start (GTK_BOX (wvbox), whbox, TRUE, TRUE, 0);
 
        /* Page size selection control */
        gl_debug (DEBUG_MEDIA_SELECT, "Creating page size combo...");
@@ -211,7 +213,7 @@ gl_wdgt_media_select_construct (glWdgtMediaSelect * media_select)
        gtk_widget_set_size_request (media_select->page_size_entry, 100, -1);
        gtk_entry_set_text (GTK_ENTRY (media_select->page_size_entry),
                            page_size);
-       gtk_box_pack_start (GTK_BOX (whbox), wcombo, FALSE, FALSE, GNOME_PAD);
+       gtk_box_pack_start (GTK_BOX (whbox), wcombo, FALSE, FALSE, 0);
 
        /* Actual selection control */
        gl_debug (DEBUG_MEDIA_SELECT, "Creating template combo...");
@@ -229,69 +231,69 @@ gl_wdgt_media_select_construct (glWdgtMediaSelect * media_select)
                                     TRUE, FALSE);
        gtk_widget_set_size_request (media_select->template_entry, 400, -1);
        gtk_box_pack_start (GTK_BOX (whbox), media_select->template_combo,
-                           FALSE, FALSE, GNOME_PAD);
+                           FALSE, FALSE, 0);
 
-       whbox = gtk_hbox_new (FALSE, GNOME_PAD);
-       gtk_box_pack_start (GTK_BOX (wvbox), whbox, TRUE, TRUE, GNOME_PAD);
+       whbox = gtk_hbox_new (FALSE, GL_HIG_SPACING);
+       gtk_box_pack_start (GTK_BOX (wvbox), whbox, TRUE, TRUE, 0);
 
        /* mini_preview canvas */
        gl_debug (DEBUG_MEDIA_SELECT, "Creating mini preview...");
        media_select->mini_preview = gl_wdgt_mini_preview_new ( WDGT_MINI_PREVIEW_HEIGHT,
                                                           WDGT_MINI_PREVIEW_WIDTH);
        gtk_box_pack_start (GTK_BOX (whbox), media_select->mini_preview,
-                           FALSE, FALSE, GNOME_PAD);
+                           FALSE, FALSE, 0);
 
        /* Label column */
        gl_debug (DEBUG_MEDIA_SELECT, "Creating label column...");
-       wvbox1 = gtk_vbox_new (FALSE, GNOME_PAD);
+       wvbox1 = gtk_vbox_new (FALSE, GL_HIG_SPACING);
        gtk_box_pack_start (GTK_BOX (whbox), wvbox1, FALSE, FALSE, 0);
 
        whbox1 = gtk_hbox_new (FALSE, 0);
        gtk_box_pack_start (GTK_BOX (wvbox1), whbox1, FALSE, FALSE, 0);
        gtk_box_pack_start (GTK_BOX (whbox1),
                            gtk_label_new (_("Description:")),
-                           FALSE, FALSE, GNOME_PAD);
+                           FALSE, FALSE, 0);
        whbox1 = gtk_hbox_new (FALSE, 0);
        gtk_box_pack_start (GTK_BOX (wvbox1), whbox1, FALSE, FALSE, 0);
        gtk_box_pack_start (GTK_BOX (whbox1),
                            gtk_label_new (_("Page size:")),
-                           FALSE, FALSE, GNOME_PAD);
+                           FALSE, FALSE, 0);
        whbox1 = gtk_hbox_new (FALSE, 0);
        gtk_box_pack_start (GTK_BOX (wvbox1), whbox1, FALSE, FALSE, 0);
        gtk_box_pack_start (GTK_BOX (whbox1),
                            gtk_label_new (_("Label size:")),
-                           FALSE, FALSE, GNOME_PAD);
+                           FALSE, FALSE, 0);
        whbox1 = gtk_hbox_new (FALSE, 0);
        gtk_box_pack_start (GTK_BOX (wvbox1), whbox1, FALSE, FALSE, 0);
        gtk_box_pack_start (GTK_BOX (whbox1),
                            gtk_label_new (_("Layout:")),
-                           FALSE, FALSE, GNOME_PAD);
+                           FALSE, FALSE, 0);
 
        /* detail widgets column */
        gl_debug (DEBUG_MEDIA_SELECT, "Creating details column...");
-       wvbox1 = gtk_vbox_new (FALSE, GNOME_PAD);
+       wvbox1 = gtk_vbox_new (FALSE, GL_HIG_SPACING);
        gtk_box_pack_start (GTK_BOX (whbox), wvbox1, FALSE, FALSE, 0);
 
        whbox1 = gtk_hbox_new (FALSE, 0);
        gtk_box_pack_start (GTK_BOX (wvbox1), whbox1, FALSE, FALSE, 0);
        media_select->desc_label = gtk_label_new ("");
        gtk_box_pack_start (GTK_BOX (whbox1), media_select->desc_label,
-                           FALSE, FALSE, GNOME_PAD);
+                           FALSE, FALSE, 0);
        whbox1 = gtk_hbox_new (FALSE, 0);
        gtk_box_pack_start (GTK_BOX (wvbox1), whbox1, FALSE, FALSE, 0);
        media_select->sheet_size_label = gtk_label_new ("");
        gtk_box_pack_start (GTK_BOX (whbox1), media_select->sheet_size_label,
-                           FALSE, FALSE, GNOME_PAD);
+                           FALSE, FALSE, 0);
        whbox1 = gtk_hbox_new (FALSE, 0);
        gtk_box_pack_start (GTK_BOX (wvbox1), whbox1, FALSE, FALSE, 0);
        media_select->label_size_label = gtk_label_new ("");
        gtk_box_pack_start (GTK_BOX (whbox1), media_select->label_size_label,
-                           FALSE, FALSE, GNOME_PAD);
+                           FALSE, FALSE, 0);
        whbox1 = gtk_hbox_new (FALSE, 0);
        gtk_box_pack_start (GTK_BOX (wvbox1), whbox1, FALSE, FALSE, 0);
        media_select->number_label = gtk_label_new ("");
        gtk_box_pack_start (GTK_BOX (whbox1), media_select->number_label,
-                           FALSE, FALSE, GNOME_PAD);
+                           FALSE, FALSE, 0);
 
        /* Update mini_preview and details from default template */
        
index 16f7bcd8610204249efae971ab67c7831482a6c6..7871722872209cb673748a50999ea7d43e4a74ee 100644 (file)
@@ -280,8 +280,15 @@ void gl_wdgt_mini_preview_set_label (glWdgtMiniPreview * preview,
        }
        gnome_canvas_set_pixels_per_unit (GNOME_CANVAS (preview->canvas),
                                          canvas_scale);
+#if 0
        gnome_canvas_set_scroll_region (GNOME_CANVAS (preview->canvas),
                                        0.0, 0.0, paper_width, paper_height);
+#else
+       gnome_canvas_set_scroll_region (GNOME_CANVAS (preview->canvas),
+                                       0.0, 0.0,
+                                       preview->width/canvas_scale,
+                                       preview->height/canvas_scale);
+#endif
 
        /* update shadow */
        shadow_x = SHADOW_X_OFFSET/canvas_scale;
index fc0776c32bd6387f50fb7495936d035f2d944720..5e22ff44f3a530e4abf82bab25f28cdecbd343ef 100644 (file)
@@ -23,6 +23,7 @@
 #include <config.h>
 
 #include "wdgt-rotate-label.h"
+#include "hig.h"
 #include "template.h"
 #include "marshal.h"
 
@@ -142,10 +143,6 @@ gl_wdgt_rotate_label_finalize (GObject * object)
 
        rotate_select = GL_WDGT_ROTATE_LABEL (object);
 
-#if 0
-       gl_template_free (&rotate_select->template);
-#endif
-
        G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
@@ -170,17 +167,18 @@ gl_wdgt_rotate_label_construct (glWdgtRotateLabel * rotate_select)
        GtkWidget *whbox;
 
        whbox = GTK_WIDGET (rotate_select);
+       gtk_box_set_spacing (GTK_BOX(whbox), GL_HIG_SPACING);
 
        /* Actual selection control */
        rotate_select->rotate_check =
            gtk_check_button_new_with_label (_("Rotate"));
        gtk_box_pack_start (GTK_BOX (whbox), rotate_select->rotate_check, TRUE,
-                           TRUE, GNOME_PAD);
+                           TRUE, 0);
 
        /* mini_preview canvas */
        rotate_select->canvas = mini_preview_canvas_new ();
        gtk_box_pack_start (GTK_BOX (whbox), rotate_select->canvas,
-                           TRUE, TRUE, GNOME_PAD);
+                           TRUE, TRUE, 0);
 
        /* Connect signals to controls */
        g_signal_connect (G_OBJECT (rotate_select->rotate_check), "toggled",