From 8c77b29af12a139d89f8edf70ca6ae2458d516dd Mon Sep 17 00:00:00 2001 From: Jim Evins Date: Thu, 19 Sep 2002 02:38:44 +0000 Subject: [PATCH] Refinements to new label dialog and associated widgets. git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@124 f5e0f49d-192f-0410-a22d-a8d8700d0965 --- glabels2/src/hig.h | 2 ++ glabels2/src/wdgt-media-select.c | 36 +++++++++++++++++--------------- glabels2/src/wdgt-mini-preview.c | 7 +++++++ glabels2/src/wdgt-rotate-label.c | 10 ++++----- 4 files changed, 32 insertions(+), 23 deletions(-) diff --git a/glabels2/src/hig.h b/glabels2/src/hig.h index c1d1359d..1e1a1965 100644 --- a/glabels2/src/hig.h +++ b/glabels2/src/hig.h @@ -27,6 +27,8 @@ G_BEGIN_DECLS +#define GL_HIG_SPACING 6 + /*===========================================================================*/ /* HIG Dialog. */ /*===========================================================================*/ diff --git a/glabels2/src/wdgt-media-select.c b/glabels2/src/wdgt-media-select.c index 03d76015..a212dba9 100644 --- a/glabels2/src/wdgt-media-select.c +++ b/glabels2/src/wdgt-media-select.c @@ -23,6 +23,7 @@ #include #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 */ diff --git a/glabels2/src/wdgt-mini-preview.c b/glabels2/src/wdgt-mini-preview.c index 16f7bcd8..78717228 100644 --- a/glabels2/src/wdgt-mini-preview.c +++ b/glabels2/src/wdgt-mini-preview.c @@ -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; diff --git a/glabels2/src/wdgt-rotate-label.c b/glabels2/src/wdgt-rotate-label.c index fc0776c3..5e22ff44 100644 --- a/glabels2/src/wdgt-rotate-label.c +++ b/glabels2/src/wdgt-rotate-label.c @@ -23,6 +23,7 @@ #include #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", -- 2.39.5