gl_debug (DEBUG_FILE, "START");
wframe = gl_hig_category_new (_("Media Type"));
- gtk_box_pack_start (GTK_BOX (dlg->vbox), wframe, FALSE, FALSE, 0);
+ gl_hig_dialog_add_widget (dlg, wframe);
template_entry = gl_wdgt_media_select_new ();
- gtk_box_pack_start (GTK_BOX (GL_HIG_CATEGORY(wframe)->vbox),
- template_entry, FALSE, FALSE, 0);
+ gl_hig_category_add_widget (GL_HIG_CATEGORY(wframe), template_entry);
wframe = gl_hig_category_new (_("Label orientation"));
- gtk_box_pack_start (GTK_BOX (dlg->vbox), wframe, FALSE, FALSE, 0);
+ gl_hig_dialog_add_widget (dlg, wframe);
rotate_sel = gl_wdgt_rotate_label_new ();
- gtk_box_pack_start (GTK_BOX (GL_HIG_CATEGORY(wframe)->vbox),
- rotate_sel, FALSE, FALSE, 0);
+ gl_hig_category_add_widget (GL_HIG_CATEGORY(wframe), rotate_sel);
g_object_set_data (G_OBJECT (dlg), "template_entry",
template_entry);
/*========================================================*/
/* Private macros and constants. */
/*========================================================*/
-#define HIG_DIALOG_BORDER 12
-#define HIG_DIALOG_VBOX_SPACING 18
-#define HIG_DIALOG_ACTION_BORDER 0
+#define HIG_DIALOG_BORDER 12
+#define HIG_DIALOG_VBOX_SPACING 18
+#define HIG_DIALOG_OUTER_VBOX_SPACING 12
-#define HIG_GENERAL_SPACING 6
+#define HIG_VBOX_OUTER_SPACING 18
+#define HIG_VBOX_OUTER_BORDER 12
+
+#define HIG_VBOX_INNER_SPACING 6
+
+#define HIG_HBOX_SPACING 6
/*===========================================*/
/* Private globals */
/*===========================================*/
static GtkDialogClass *hig_dialog_parent_class;
static GtkVBoxClass *hig_category_parent_class;
+static GtkVBoxClass *hig_vbox_parent_class;
+static GtkHBoxClass *hig_hbox_parent_class;
/*===========================================*/
static void gl_hig_category_init (glHigCategory *hig_category);
static void gl_hig_category_finalize (GObject *object);
+static void gl_hig_vbox_class_init (glHigVBoxClass *class);
+static void gl_hig_vbox_init (glHigVBox *hig_vbox);
+static void gl_hig_vbox_finalize (GObject *object);
+
+static void gl_hig_hbox_class_init (glHigHBoxClass *class);
+static void gl_hig_hbox_init (glHigHBox *hig_hbox);
+static void gl_hig_hbox_finalize (GObject *object);
+
\f
/****************************************************************************/
/* Boilerplate Dialog Object stuff. */
hig_dialog->vbox = gtk_vbox_new (FALSE, HIG_DIALOG_VBOX_SPACING);
gtk_box_pack_start (GTK_BOX(GTK_DIALOG(hig_dialog)->vbox),
hig_dialog->vbox, FALSE, FALSE, 0);
+
gtk_box_set_spacing (GTK_BOX(GTK_DIALOG(hig_dialog)->vbox),
- HIG_DIALOG_VBOX_SPACING);
+ HIG_DIALOG_OUTER_VBOX_SPACING);
}
static void
}
}
+/****************************************************************************/
+/* Add widget (from top) to dialog's vbox. */
+/****************************************************************************/
+void
+gl_hig_dialog_add_widget (glHigDialog *dialog,
+ GtkWidget *widget)
+{
+ gtk_box_pack_start (GTK_BOX (dialog->vbox), widget, FALSE, FALSE, 0);
+}
+
\f
/****************************************************************************/
/* Boilerplate Category Object stuff. */
{
GtkWidget *hbox;
- gtk_box_set_spacing (GTK_BOX(hig_category), HIG_GENERAL_SPACING);
+ gtk_box_set_spacing (GTK_BOX(hig_category), HIG_VBOX_INNER_SPACING);
/* 1st row: Label */
hig_category->label = gtk_label_new ("");
hig_category->label, FALSE, FALSE, 0);
/* 2nd row: HBOX */
- hbox = gtk_hbox_new (FALSE, HIG_GENERAL_SPACING);
+ hbox = gtk_hbox_new (FALSE, HIG_VBOX_INNER_SPACING);
gtk_box_pack_start (GTK_BOX(hig_category), hbox, FALSE, FALSE, 0);
/* 2nd row, Column 1: Indentation spacing */
gtk_label_new (" "), FALSE, FALSE, 0);
/* 2nd row, Column 2: User area (inner vbox) */
- hig_category->vbox = gtk_vbox_new (FALSE, HIG_GENERAL_SPACING);
+ hig_category->vbox = gtk_vbox_new (FALSE, HIG_VBOX_INNER_SPACING);
gtk_box_pack_start (GTK_BOX(hbox),
hig_category->vbox, FALSE, FALSE, 0);
}
return category;
}
+/****************************************************************************/
+/* Add widget (from top) to category's vbox. */
+/****************************************************************************/
+void
+gl_hig_category_add_widget (glHigCategory *cat,
+ GtkWidget *widget)
+{
+ gtk_box_pack_start (GTK_BOX (cat->vbox), widget, FALSE, FALSE, 0);
+}
+
+
+\f
+/****************************************************************************/
+/* Boilerplate VBox Object stuff. */
+/****************************************************************************/
+guint
+gl_hig_vbox_get_type (void)
+{
+ static guint hig_vbox_type = 0;
+
+ if (!hig_vbox_type) {
+ GTypeInfo hig_vbox_info = {
+ sizeof (glHigVBoxClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) gl_hig_vbox_class_init,
+ NULL,
+ NULL,
+ sizeof (glHigVBox),
+ 0,
+ (GInstanceInitFunc) gl_hig_vbox_init,
+ };
+
+ hig_vbox_type =
+ g_type_register_static (gtk_vbox_get_type (),
+ "glHigVBox",
+ &hig_vbox_info, 0);
+ }
+
+ return hig_vbox_type;
+}
+
+static void
+gl_hig_vbox_class_init (glHigVBoxClass *class)
+{
+ GObjectClass *object_class = (GObjectClass *) class;
+
+ hig_vbox_parent_class = g_type_class_peek_parent (class);
+
+ object_class->finalize = gl_hig_vbox_finalize;
+}
+
+static void
+gl_hig_vbox_init (glHigVBox *hig_vbox)
+{
+ /* defaults to an INNER VBox */
+ gtk_box_set_spacing (GTK_BOX(hig_vbox), HIG_VBOX_INNER_SPACING);
+ gtk_container_set_border_width (GTK_CONTAINER(hig_vbox), 0);
+}
+
+static void
+gl_hig_vbox_finalize (GObject *object)
+{
+ glHigVBox *hig_vbox;
+
+ g_return_if_fail (object != NULL);
+ g_return_if_fail (GL_IS_HIG_VBOX (object));
+
+ hig_vbox = GL_HIG_VBOX (object);
+
+ G_OBJECT_CLASS (hig_vbox_parent_class)->finalize (object);
+}
+
+
+/****************************************************************************/
+/* Create a vbox wrapper that attempts to be HIG compliant. */
+/****************************************************************************/
+GtkWidget* gl_hig_vbox_new (glHigVBoxType type)
+{
+ GtkWidget *hig_vbox;
+
+ hig_vbox = g_object_new (gl_hig_vbox_get_type (), NULL);
+
+ switch (type) {
+
+ case GL_HIG_VBOX_OUTER:
+ gtk_box_set_spacing (GTK_BOX(hig_vbox),
+ HIG_VBOX_OUTER_SPACING);
+ gtk_container_set_border_width (GTK_CONTAINER(hig_vbox),
+ HIG_VBOX_OUTER_BORDER);
+ break;
+
+ case GL_HIG_VBOX_INNER:
+ gtk_box_set_spacing (GTK_BOX(hig_vbox),
+ HIG_VBOX_INNER_SPACING);
+ gtk_container_set_border_width (GTK_CONTAINER(hig_vbox), 0);
+
+ default:
+ break;
+
+ }
+
+ return hig_vbox;
+}
+
+/****************************************************************************/
+/* Add widget (from top) to vbox. */
+/****************************************************************************/
+void
+gl_hig_vbox_add_widget (glHigVBox *hig_vbox,
+ GtkWidget *widget)
+{
+ gtk_box_pack_start (GTK_BOX (hig_vbox), widget, FALSE, FALSE, 0);
+}
+
+\f
+/****************************************************************************/
+/* Boilerplate HBox Object stuff. */
+/****************************************************************************/
+guint
+gl_hig_hbox_get_type (void)
+{
+ static guint hig_hbox_type = 0;
+
+ if (!hig_hbox_type) {
+ GTypeInfo hig_hbox_info = {
+ sizeof (glHigHBoxClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) gl_hig_hbox_class_init,
+ NULL,
+ NULL,
+ sizeof (glHigHBox),
+ 0,
+ (GInstanceInitFunc) gl_hig_hbox_init,
+ };
+
+ hig_hbox_type =
+ g_type_register_static (gtk_hbox_get_type (),
+ "glHigHBox",
+ &hig_hbox_info, 0);
+ }
+
+ return hig_hbox_type;
+}
+
+static void
+gl_hig_hbox_class_init (glHigHBoxClass *class)
+{
+ GObjectClass *object_class = (GObjectClass *) class;
+
+ hig_hbox_parent_class = g_type_class_peek_parent (class);
+
+ object_class->finalize = gl_hig_hbox_finalize;
+}
+
+static void
+gl_hig_hbox_init (glHigHBox *hig_hbox)
+{
+ gtk_box_set_spacing (GTK_BOX(hig_hbox), HIG_HBOX_SPACING);
+ gtk_container_set_border_width (GTK_CONTAINER(hig_hbox), 0);
+}
+
+static void
+gl_hig_hbox_finalize (GObject *object)
+{
+ glHigHBox *hig_hbox;
+
+ g_return_if_fail (object != NULL);
+ g_return_if_fail (GL_IS_HIG_HBOX (object));
+
+ hig_hbox = GL_HIG_HBOX (object);
+
+ G_OBJECT_CLASS (hig_hbox_parent_class)->finalize (object);
+}
+
+
+/****************************************************************************/
+/* Create a hbox wrapper that attempts to be HIG compliant. */
+/****************************************************************************/
+GtkWidget* gl_hig_hbox_new (void)
+{
+ GtkWidget *hig_hbox;
+
+ hig_hbox = g_object_new (gl_hig_hbox_get_type (), NULL);
+
+ return hig_hbox;
+}
+
+/****************************************************************************/
+/* Add widget (from left) to hbox. */
+/****************************************************************************/
+void
+gl_hig_hbox_add_widget (glHigHBox *hig_hbox,
+ GtkWidget *widget)
+{
+ gtk_box_pack_start (GTK_BOX (hig_hbox), widget, FALSE, FALSE, 0);
+}
+
+
G_BEGIN_DECLS
-#define GL_HIG_SPACING 6
-
/*===========================================================================*/
-/* HIG Dialog. */
+/* HIG Dialog wrapper. */
/*===========================================================================*/
#define GL_TYPE_HIG_DIALOG (gl_hig_dialog_get_type ())
const gchar *first_button_text,
...);
+void gl_hig_dialog_add_widget (glHigDialog *dialog,
+ GtkWidget *widget);
+
/*===========================================================================*/
-/* HIG Category. */
+/* HIG Category (analogous to a gtk_frame). */
/*===========================================================================*/
#define GL_TYPE_HIG_CATEGORY (gl_hig_category_get_type ())
GtkWidget *gl_hig_category_new (const gchar *header);
+void gl_hig_category_add_widget (glHigCategory *cat,
+ GtkWidget *widget);
+
+G_END_DECLS
+
+/*===========================================================================*/
+/* HIG VBOX wrapper. */
+/*===========================================================================*/
+
+typedef enum {
+ GL_HIG_VBOX_OUTER,
+ GL_HIG_VBOX_INNER,
+} glHigVBoxType;
+
+#define GL_TYPE_HIG_VBOX (gl_hig_vbox_get_type ())
+#define GL_HIG_VBOX(obj) \
+ (GTK_CHECK_CAST((obj), GL_TYPE_HIG_VBOX, glHigVBox ))
+#define GL_HIG_VBOX_CLASS(klass) \
+ (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_HIG_VBOX, glHigVBoxClass))
+#define GL_IS_HIG_VBOX(obj) \
+ (GTK_CHECK_TYPE ((obj), GL_TYPE_HIG_VBOX))
+#define GL_IS_HIG_VBOX_CLASS(klass) \
+ (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_HIG_VBOX))
+
+typedef struct _glHigVBox glHigVBox;
+typedef struct _glHigVBoxClass glHigVBoxClass;
+
+struct _glHigVBox {
+ GtkVBox parent_widget;
+};
+
+struct _glHigVBoxClass {
+ GtkVBoxClass parent_class;
+};
+
+guint gl_hig_vbox_get_type (void);
+
+GtkWidget *gl_hig_vbox_new (glHigVBoxType type);
+
+void gl_hig_vbox_add_widget (glHigVBox *hig_vbox,
+ GtkWidget *widget);
+
+/*===========================================================================*/
+/* HIG HBOX wrapper. */
+/*===========================================================================*/
+
+#define GL_TYPE_HIG_HBOX (gl_hig_hbox_get_type ())
+#define GL_HIG_HBOX(obj) \
+ (GTK_CHECK_CAST((obj), GL_TYPE_HIG_HBOX, glHigHBox ))
+#define GL_HIG_HBOX_CLASS(klass) \
+ (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_HIG_HBOX, glHigHBoxClass))
+#define GL_IS_HIG_HBOX(obj) \
+ (GTK_CHECK_TYPE ((obj), GL_TYPE_HIG_HBOX))
+#define GL_IS_HIG_HBOX_CLASS(klass) \
+ (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_HIG_HBOX))
+
+typedef struct _glHigHBox glHigHBox;
+typedef struct _glHigHBoxClass glHigHBoxClass;
+
+struct _glHigHBox {
+ GtkHBox parent_widget;
+};
+
+struct _glHigHBoxClass {
+ GtkHBoxClass parent_class;
+};
+
+guint gl_hig_hbox_get_type (void);
+
+GtkWidget *gl_hig_hbox_new (void);
+
+void gl_hig_hbox_add_widget (glHigHBox *hig_hbox,
+ GtkWidget *widget);
+
G_END_DECLS
#endif /* __HIG_H__ */
#include <libgnomeprintui/gnome-print-master-preview.h>
#include "print-dialog.h"
+#include "hig.h"
#include "print.h"
#include "label.h"
#include "bc.h"
g_return_if_fail (win != NULL);
/* ----- Contstruct basic print dialog with notebook ----- */
- dlg = gtk_dialog_new_with_buttons (_("Print"), GTK_WINDOW(win),
+ dlg = gl_hig_dialog_new_with_buttons (_("Print"), GTK_WINDOW(win),
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_PRINT, GNOME_PRINT_DIALOG_RESPONSE_PRINT,
gtk_dialog_set_default_response (GTK_DIALOG (dlg),
GNOME_PRINT_DIALOG_RESPONSE_PRINT);
notebook = gtk_notebook_new ();
- gtk_container_set_border_width (GTK_CONTAINER (notebook), 4);
gtk_widget_show (notebook);
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dlg)->vbox), notebook);
-
+ gl_hig_dialog_add_widget (GL_HIG_DIALOG(dlg), notebook);
/* ----- Create Job notebook page ----- */
page = job_page_new (dlg, label);
GList *record_list;
gint n_records;
- vbox = gtk_vbox_new (FALSE, 0);
+ vbox = gl_hig_vbox_new (GL_HIG_VBOX_OUTER);
merge = gl_label_get_merge (label);
if (merge->type == GL_MERGE_NONE) {
/* ----------- Add simple-copies widget ------------ */
- wframe = gtk_frame_new (_("Copies"));
- gtk_box_pack_start (GTK_BOX (vbox), wframe, FALSE, FALSE, 0);
+ wframe = gl_hig_category_new (_("Copies"));
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(vbox), wframe);
copies = gl_wdgt_print_copies_new (label);
- gtk_container_set_border_width (GTK_CONTAINER (copies),
- GNOME_PAD_SMALL);
- gtk_container_add (GTK_CONTAINER (wframe), copies);
+ gl_hig_category_add_widget (GL_HIG_CATEGORY(wframe), copies);
if (n_sheets) {
gl_wdgt_print_copies_set_range (GL_WDGT_PRINT_COPIES (copies),
} else {
/* ------- Otherwise add merge control widget ------------ */
- wframe = gtk_frame_new (_("Document merge control"));
- gtk_box_pack_start (GTK_BOX (vbox), wframe, FALSE, FALSE, 0);
+ wframe = gl_hig_category_new (_("Document merge control"));
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(vbox), wframe);
prmerge = gl_wdgt_print_merge_new (label);
- gtk_container_set_border_width (GTK_CONTAINER (prmerge),
- GNOME_PAD_SMALL);
- gtk_container_add (GTK_CONTAINER (wframe), prmerge);
+ gl_hig_category_add_widget (GL_HIG_CATEGORY(wframe), prmerge);
record_list = gl_merge_read_data (merge->type,
merge->field_defs,
g_object_set_data (G_OBJECT(dlg), "prmerge", prmerge);
/* ----------- Add custom print options area ------------ */
- wframe = gtk_frame_new (_("Options"));
- gtk_box_pack_start (GTK_BOX (vbox), wframe, FALSE, FALSE, 0);
- wvbox = gtk_vbox_new (FALSE, GNOME_PAD);
- gtk_container_set_border_width (GTK_CONTAINER (wvbox),
- GNOME_PAD_SMALL);
- gtk_container_add (GTK_CONTAINER (wframe), wvbox);
+ wframe = gl_hig_category_new (_("Options"));
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(vbox), wframe);
/* add Outline check button */
outline_check =
gtk_check_button_new_with_label (
_("print outlines (to test printer alignment)"));
- gtk_box_pack_start (GTK_BOX (wvbox), outline_check, FALSE, FALSE, 0);
+ gl_hig_category_add_widget (GL_HIG_CATEGORY(wframe), outline_check);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (outline_check),
outline_flag);
g_object_set_data (G_OBJECT(dlg), "outline_check", outline_check);
reverse_check =
gtk_check_button_new_with_label (
_("print in reverse (i.e. a mirror image)"));
- gtk_box_pack_start (GTK_BOX (wvbox), reverse_check, FALSE, FALSE, 0);
+ gl_hig_category_add_widget (GL_HIG_CATEGORY(wframe), reverse_check);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (reverse_check),
reverse_flag);
g_object_set_data (G_OBJECT(dlg), "reverse_check", reverse_check);
GtkWidget *vbox;
GtkWidget *printer_select;
- vbox = gtk_vbox_new (FALSE, 0);
+ vbox = gl_hig_vbox_new (GL_HIG_VBOX_OUTER);
printer_select =
gnome_printer_selection_new (gnome_print_config_default ());
- gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);
gtk_widget_show (printer_select);
- gtk_box_pack_start (GTK_BOX(vbox), printer_select, FALSE, FALSE, 0);
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(vbox), printer_select);
g_object_set_data (G_OBJECT(dlg), "printer_select", printer_select);
template = g_new0 (glTemplate, 1);
template->name = g_list_append (template->name,
- g_strdup_printf("*%s", page_size));
+ g_strdup_printf(_("Generic %s full page"),
+ page_size));
template->page_size = g_strdup(page_size);
template->description = g_strdup(FULL_PAGE);
};
wdgt_media_select_type =
- g_type_register_static (gtk_vbox_get_type (),
+ g_type_register_static (gl_hig_vbox_get_type (),
"glWdgtMediaSelect",
&wdgt_media_select_info, 0);
}
object_class = (GObjectClass *) class;
- parent_class = gtk_type_class (gtk_vbox_get_type ());
+ parent_class = g_type_class_peek_parent (class);
object_class->finalize = gl_wdgt_media_select_finalize;
static void
gl_wdgt_media_select_construct (glWdgtMediaSelect * media_select)
{
- GtkWidget *whbox, *wvbox, *wcombo, *wvbox1, *whbox1;
+ GtkWidget *whbox, *wvbox, *wcombo, *wvbox1, *whbox1, *wlabel;
+ GtkSizeGroup *label_size_group;
gchar *name;
GList *template_names, *page_sizes = NULL;
const gchar *page_size;
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, GL_HIG_SPACING);
- gtk_box_pack_start (GTK_BOX (wvbox), whbox, TRUE, TRUE, 0);
+ whbox = gl_hig_hbox_new ();
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(wvbox), whbox);
/* Page size selection control */
gl_debug (DEBUG_MEDIA_SELECT, "Creating page size combo...");
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, 0);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox), wcombo);
/* Actual selection control */
gl_debug (DEBUG_MEDIA_SELECT, "Creating template combo...");
gtk_combo_set_value_in_list (GTK_COMBO(media_select->template_combo),
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, 0);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox),
+ media_select->template_combo);
- whbox = gtk_hbox_new (FALSE, GL_HIG_SPACING);
- gtk_box_pack_start (GTK_BOX (wvbox), whbox, TRUE, TRUE, 0);
+ whbox = gl_hig_hbox_new ();
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(wvbox), whbox);
/* 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, 0);
-
- /* Label column */
- gl_debug (DEBUG_MEDIA_SELECT, "Creating label column...");
- 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 (""),
- 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, 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, 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, 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, 0);
-
- /* detail widgets column */
- gl_debug (DEBUG_MEDIA_SELECT, "Creating details column...");
- 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 (""),
- FALSE, FALSE, 0);
- whbox1 = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (wvbox1), whbox1, FALSE, FALSE, 0);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox),
+ media_select->mini_preview);
+
+ /* ---- Information area ---- */
+ wvbox1 = gl_hig_vbox_new (GL_HIG_VBOX_INNER);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox), wvbox1);
+ label_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
+
+ /* blank line */
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(wvbox1), gtk_label_new (""));
+
+ /* Description line */
+ whbox1 = gl_hig_hbox_new ();
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(wvbox1), whbox1);
+ wlabel = gtk_label_new (_("Description:"));
+ gtk_size_group_add_widget (label_size_group, wlabel);
+ gtk_misc_set_alignment (GTK_MISC(wlabel), 0.0, 0.0);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox1), wlabel);
media_select->desc_label = gtk_label_new ("");
- gtk_box_pack_start (GTK_BOX (whbox1), media_select->desc_label,
- FALSE, FALSE, 0);
- whbox1 = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (wvbox1), whbox1, FALSE, FALSE, 0);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox1), media_select->desc_label);
+
+ /* Page size line */
+ whbox1 = gl_hig_hbox_new ();
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(wvbox1), whbox1);
+ wlabel = gtk_label_new (_("Page size:"));
+ gtk_size_group_add_widget (label_size_group, wlabel);
+ gtk_misc_set_alignment (GTK_MISC(wlabel), 0.0, 0.0);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox1), wlabel);
media_select->sheet_size_label = gtk_label_new ("");
- gtk_box_pack_start (GTK_BOX (whbox1), media_select->sheet_size_label,
- FALSE, FALSE, 0);
- whbox1 = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (wvbox1), whbox1, FALSE, FALSE, 0);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox1),
+ media_select->sheet_size_label);
+
+ /* Label size line */
+ whbox1 = gl_hig_hbox_new ();
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(wvbox1), whbox1);
+ wlabel = gtk_label_new (_("Label size:"));
+ gtk_size_group_add_widget (label_size_group, wlabel);
+ gtk_misc_set_alignment (GTK_MISC(wlabel), 0.0, 0.0);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox1), wlabel);
media_select->label_size_label = gtk_label_new ("");
- gtk_box_pack_start (GTK_BOX (whbox1), media_select->label_size_label,
- FALSE, FALSE, 0);
- whbox1 = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (wvbox1), whbox1, FALSE, FALSE, 0);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox1),
+ media_select->label_size_label);
+
+ /* Layout line */
+ whbox1 = gl_hig_hbox_new ();
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(wvbox1), whbox1);
+ wlabel = gtk_label_new (_("Layout:"));
+ gtk_size_group_add_widget (label_size_group, wlabel);
+ gtk_misc_set_alignment (GTK_MISC(wlabel), 0.0, 0.0);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox1), wlabel);
media_select->number_label = gtk_label_new ("");
- gtk_box_pack_start (GTK_BOX (whbox1), media_select->number_label,
- FALSE, FALSE, 0);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox1),
+ media_select->number_label);
/* Update mini_preview and details from default template */
#define __WDGT_MEDIA_SELECT_H__
#include <gnome.h>
+#include "hig.h"
#define GL_TYPE_WDGT_MEDIA_SELECT (gl_wdgt_media_select_get_type ())
#define GL_WDGT_MEDIA_SELECT(obj) \
typedef struct _glWdgtMediaSelectClass glWdgtMediaSelectClass;
struct _glWdgtMediaSelect {
- GtkVBox parent_widget;
+ glHigVBox parent_widget;
GtkWidget *page_size_entry;
GtkWidget *template_combo;
};
struct _glWdgtMediaSelectClass {
- GtkVBoxClass parent_class;
+ glHigVBoxClass parent_class;
void (*changed) (glWdgtMediaSelect * media_select, gpointer user_data);
};
};
wdgt_print_copies_type =
- g_type_register_static (gtk_hbox_get_type (),
+ g_type_register_static (gl_hig_hbox_get_type (),
"glWdgtPrintCopies",
&wdgt_print_copies_info, 0);
}
object_class = (GObjectClass *) class;
- parent_class = gtk_type_class (gtk_hbox_get_type ());
+ parent_class = g_type_class_peek_parent (class);
object_class->finalize = gl_wdgt_print_copies_finalize;
}
/* Construct composite widget. */
/*--------------------------------------------------------------------------*/
static void
-gl_wdgt_print_copies_construct (glWdgtPrintCopies * copies,
- glLabel * label)
+gl_wdgt_print_copies_construct (glWdgtPrintCopies *copies,
+ glLabel *label)
{
GtkWidget *whbox, *wvbox, *whbox1;
GSList *radio_group = NULL;
WDGT_MINI_PREVIEW_WIDTH);
gl_wdgt_mini_preview_set_label (GL_WDGT_MINI_PREVIEW(copies->mini_preview),
template->name->data);
- gtk_box_pack_start (GTK_BOX (whbox), copies->mini_preview,
- TRUE, TRUE, GNOME_PAD);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox), copies->mini_preview);
- wvbox = gtk_vbox_new (FALSE, GNOME_PAD);
- gtk_box_pack_start (GTK_BOX (whbox), wvbox, TRUE, TRUE, GNOME_PAD);
+ wvbox = gl_hig_vbox_new (GL_HIG_VBOX_INNER);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox), wvbox);
/* Sheet controls */
- whbox1 = gtk_hbox_new (FALSE, GNOME_PAD);
- gtk_box_pack_start (GTK_BOX (wvbox), whbox1, FALSE, FALSE, GNOME_PAD);
+ whbox1 = gl_hig_hbox_new ();
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(wvbox), whbox1);
copies->sheets_radio =
gtk_radio_button_new_with_label (radio_group, _("Sheets:"));
- gtk_box_pack_start (GTK_BOX (whbox1), copies->sheets_radio,
- FALSE, FALSE, 0);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox1), copies->sheets_radio);
adjust = gtk_adjustment_new (1, 1.0, 10.0, 1.0, 10.0, 10.0);
copies->sheets_spin = gtk_spin_button_new (GTK_ADJUSTMENT (adjust),
1.0, 0);
- gtk_box_pack_start (GTK_BOX (whbox1), copies->sheets_spin,
- FALSE, FALSE, 0);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox1), copies->sheets_spin);
gl_wdgt_mini_preview_highlight_range (GL_WDGT_MINI_PREVIEW(copies->mini_preview),
- 1, copies->labels_per_sheet);
+ 1, copies->labels_per_sheet);
+
+ /* Blank line */
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(wvbox), gtk_label_new (""));
/* Label controls */
- whbox1 = gtk_hbox_new (FALSE, GNOME_PAD);
- gtk_box_pack_start (GTK_BOX (wvbox), whbox1, FALSE, FALSE, GNOME_PAD);
+ whbox1 = gl_hig_hbox_new ();
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(wvbox), whbox1);
radio_group =
gtk_radio_button_get_group (GTK_RADIO_BUTTON (copies->sheets_radio));
copies->labels_radio =
gtk_radio_button_new_with_label (radio_group, _("Labels"));
- gtk_box_pack_start (GTK_BOX (whbox1), copies->labels_radio,
- FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (whbox1), gtk_label_new (_("from:")),
- FALSE, FALSE, 0);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox1), copies->labels_radio);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox1),
+ gtk_label_new (_("from:")));
adjust = gtk_adjustment_new (1, 1.0, copies->labels_per_sheet,
1.0, 10.0, 10.0);
copies->first_spin = gtk_spin_button_new (GTK_ADJUSTMENT (adjust),
1.0, 0);
- gtk_box_pack_start (GTK_BOX (whbox1), copies->first_spin,
- FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (whbox1), gtk_label_new (_("to:")),
- FALSE, FALSE, 0);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox1), copies->first_spin);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox1),
+ gtk_label_new (_("to:")));
adjust = gtk_adjustment_new (copies->labels_per_sheet,
1.0, copies->labels_per_sheet,
1.0, 10.0, 10.0);
copies->last_spin = gtk_spin_button_new (GTK_ADJUSTMENT (adjust),
1.0, 0);
- gtk_box_pack_start (GTK_BOX (whbox1), copies->last_spin,
- FALSE, FALSE, 0);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox1), copies->last_spin);
gtk_widget_set_sensitive (copies->first_spin, FALSE);
gtk_widget_set_sensitive (copies->last_spin, FALSE);
#include <gnome.h>
#include "label.h"
+#include "hig.h"
#define GL_TYPE_WDGT_PRINT_COPIES (gl_wdgt_print_copies_get_type ())
#define GL_WDGT_PRINT_COPIES(obj) \
typedef struct _glWdgtPrintCopiesClass glWdgtPrintCopiesClass;
struct _glWdgtPrintCopies {
- GtkHBox parent_widget;
+ glHigHBox parent_widget;
gint labels_per_sheet;
};
struct _glWdgtPrintCopiesClass {
- GtkHBoxClass parent_class;
+ glHigHBoxClass parent_class;
};
extern guint gl_wdgt_print_copies_get_type (void);
};
wdgt_print_merge_type =
- g_type_register_static (gtk_hbox_get_type (),
+ g_type_register_static (gl_hig_hbox_get_type (),
"glWdgtPrintMerge",
&wdgt_print_merge_info, 0);
}
object_class = (GObjectClass *) class;
- parent_class = gtk_type_class (gtk_hbox_get_type ());
+ parent_class = g_type_class_peek_parent (class);
object_class->finalize = gl_wdgt_print_merge_finalize;
}
WDGT_MINI_PREVIEW_WIDTH);
gl_wdgt_mini_preview_set_label( GL_WDGT_MINI_PREVIEW (merge->mini_preview),
template->name->data );
- gtk_box_pack_start (GTK_BOX (whbox), merge->mini_preview,
- TRUE, TRUE, GNOME_PAD);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox), merge->mini_preview);
gl_wdgt_mini_preview_highlight_range (GL_WDGT_MINI_PREVIEW(merge->mini_preview),
1, 1);
- wvbox = gtk_vbox_new (FALSE, GNOME_PAD);
- gtk_box_pack_start (GTK_BOX (whbox), wvbox, TRUE, TRUE, GNOME_PAD);
+ wvbox = gl_hig_vbox_new (GL_HIG_VBOX_INNER);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox), wvbox);
/* First Label controls */
- whbox1 = gtk_hbox_new (FALSE, GNOME_PAD);
- gtk_box_pack_start (GTK_BOX (wvbox), whbox1, FALSE, FALSE, GNOME_PAD);
- gtk_box_pack_start (GTK_BOX (whbox1),
- gtk_label_new (_("Start on label")), FALSE, FALSE,
- 0);
+ whbox1 = gl_hig_hbox_new ();
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(wvbox), whbox1);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox1),
+ gtk_label_new (_("Start on label")));
adjust =
gtk_adjustment_new (1, 1.0, merge->labels_per_sheet, 1.0, 10.0,
10.0);
merge->first_spin =
gtk_spin_button_new (GTK_ADJUSTMENT (adjust), 1.0, 0);
- gtk_box_pack_start (GTK_BOX (whbox1), merge->first_spin, FALSE, FALSE,
- 0);
- gtk_box_pack_start (GTK_BOX (whbox1), gtk_label_new (_("on 1st sheet")),
- FALSE, FALSE, 0);
-
- /* Collate controls */
- whbox1 = gtk_hbox_new (FALSE, GNOME_PAD);
- gtk_box_pack_end (GTK_BOX (wvbox), whbox1, FALSE, FALSE, GNOME_PAD);
- pixbuf = gdk_pixbuf_new_from_xpm_data ( (const char **)nocollate_xpm);
- merge->collate_image = gtk_image_new_from_pixbuf(pixbuf);
-
- gtk_box_pack_start (GTK_BOX (whbox1), merge->collate_image,
- FALSE, FALSE, 0);
- merge->collate_check = gtk_check_button_new_with_label (_("Collate"));
- gtk_box_pack_start (GTK_BOX (whbox1), merge->collate_check,
- FALSE, FALSE, 0);
-
- /* Copy controls */
- whbox1 = gtk_hbox_new (FALSE, GNOME_PAD);
- gtk_box_pack_end (GTK_BOX (wvbox), whbox1, FALSE, FALSE, GNOME_PAD);
- gtk_box_pack_start (GTK_BOX (whbox1), gtk_label_new (_("Copies:")),
- FALSE, FALSE, 0);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox1), merge->first_spin);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox1),
+ gtk_label_new (_("on 1st sheet")));
+
+ /* Blank line */
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(wvbox), gtk_label_new (""));
+
+ /* Copy & collate controls*/
+ whbox1 = gl_hig_hbox_new ();
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(wvbox), whbox1);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox1),
+ gtk_label_new (_("Copies:")));
adjust = gtk_adjustment_new (1, 1.0, 10.0, 1.0, 10.0, 10.0);
merge->copies_spin = gtk_spin_button_new (GTK_ADJUSTMENT (adjust),
1.0, 0);
- gtk_box_pack_start (GTK_BOX (whbox1), merge->copies_spin,
- FALSE, FALSE, 0);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox1), merge->copies_spin);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox1), gtk_label_new (" "));
+ merge->collate_check = gtk_check_button_new_with_label (_("Collate"));
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox1), merge->collate_check);
+ pixbuf = gdk_pixbuf_new_from_xpm_data ( (const char **)nocollate_xpm);
+ merge->collate_image = gtk_image_new_from_pixbuf(pixbuf);
+ gtk_widget_set_sensitive (merge->collate_check, FALSE);
+ gtk_widget_set_sensitive (merge->collate_image, FALSE);
+
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox1), merge->collate_image);
/* Connect signals to controls */
g_signal_connect (G_OBJECT (merge->mini_preview), "clicked",
last = first + (n_copies * merge->n_records) - 1;
gl_wdgt_mini_preview_highlight_range (GL_WDGT_MINI_PREVIEW(merge->mini_preview),
first, last );
+
+ gtk_widget_set_sensitive (merge->collate_check, (n_copies > 1));
+ gtk_widget_set_sensitive (merge->collate_image, (n_copies > 1));
}
/*--------------------------------------------------------------------------*/
#include <gnome.h>
#include "label.h"
+#include "hig.h"
#define GL_TYPE_WDGT_PRINT_MERGE (gl_wdgt_print_merge_get_type ())
#define GL_WDGT_PRINT_MERGE(obj) \
typedef struct _glWdgtPrintMergeClass glWdgtPrintMergeClass;
struct _glWdgtPrintMerge {
- GtkHBox parent_widget;
+ glHigHBox parent_widget;
gint labels_per_sheet;
GtkWidget *mini_preview;
};
struct _glWdgtPrintMergeClass {
- GtkHBoxClass parent_class;
+ glHigHBoxClass parent_class;
};
extern guint gl_wdgt_print_merge_get_type (void);
#include "hig.h"
#include "template.h"
#include "marshal.h"
+#include "color.h"
#include "debug.h"
+/*========================================================*/
+/* Private macros and constants. */
+/*========================================================*/
#define MINI_PREVIEW_MAX_PIXELS 48
+#define LINE_COLOR GL_COLOR(0,0,0)
+#define FILL_COLOR GL_COLOR(255,255,255)
+#define UNSENSITIVE_LINE_COLOR GL_COLOR(0x66,0x66,0x66)
+#define UNSENSITIVE_FILL_COLOR GL_COLOR(0xCC,0xCC,0xCC)
+
/*===========================================*/
/* Private types */
/*===========================================*/
};
wdgt_rotate_label_type =
- g_type_register_static (gtk_hbox_get_type (),
+ g_type_register_static (gl_hig_hbox_get_type (),
"glWdgtRotateLabel",
&wdgt_rotate_label_info, 0);
}
object_class = (GObjectClass *) class;
- parent_class = gtk_type_class (gtk_hbox_get_type ());
+ parent_class = g_type_class_peek_parent (class);
object_class->finalize = gl_wdgt_rotate_label_finalize;
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, 0);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox),
+ rotate_select->rotate_check);
/* mini_preview canvas */
rotate_select->canvas = mini_preview_canvas_new ();
- gtk_box_pack_start (GTK_BOX (whbox), rotate_select->canvas,
- TRUE, TRUE, 0);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox), rotate_select->canvas);
/* Connect signals to controls */
g_signal_connect (G_OBJECT (rotate_select->rotate_check), "toggled",
GnomeCanvasGroup *group = NULL;
GnomeCanvasItem *label_item = NULL;
gdouble m, raw_w, raw_h, w, h;
+ guint line_color, fill_color;
/* Fetch our data from canvas */
label_item = g_object_get_data (G_OBJECT (canvas), "label_item");
gtk_object_destroy (GTK_OBJECT (label_item));
}
+ /* Adjust sensitivity (should the canvas be grayed?) */
+ if (raw_w != raw_h) {
+ line_color = LINE_COLOR;
+ fill_color = FILL_COLOR;
+ } else {
+ line_color = UNSENSITIVE_LINE_COLOR;
+ fill_color = UNSENSITIVE_FILL_COLOR;
+ }
+
/* draw mini label outline */
if (!rotate_flag) {
w = raw_w;
"x2", +w / 2.0,
"y2", +h / 2.0,
"width_pixels", 1,
- "outline_color", "black",
- "fill_color", "white",
+ "outline_color_rgba", line_color,
+ "fill_color_rgba", fill_color,
NULL);
break;
case GL_TEMPLATE_STYLE_ROUND:
"x2", +w / 2.0,
"y2", +h / 2.0,
"width_pixels", 2,
- "outline_color", "black",
- "fill_color", "white",
+ "outline_color_rgba", line_color,
+ "fill_color_rgba", fill_color,
NULL);
break;
default:
rotate_select->template = template;
gl_template_get_label_size (template, &raw_w, &raw_h);
- if (raw_w != raw_h) {
- gtk_widget_set_sensitive (rotate_select->rotate_check, TRUE);
- } else {
- gtk_widget_set_sensitive (rotate_select->rotate_check, FALSE);
- }
+ gtk_widget_set_sensitive (rotate_select->rotate_check,
+ (raw_w != raw_h));
mini_preview_canvas_update (GNOME_CANVAS (rotate_select->canvas),
template, FALSE);
#define __WDGT_ROTATE_LABEL_H__
#include <gnome.h>
+#include "hig.h"
#include "template.h"
#define GL_TYPE_WDGT_ROTATE_LABEL (gl_wdgt_rotate_label_get_type ())
typedef struct _glWdgtRotateLabelClass glWdgtRotateLabelClass;
struct _glWdgtRotateLabel {
- GtkHBox parent_widget;
+ glHigHBox parent_widget;
GtkWidget *rotate_check;
};
struct _glWdgtRotateLabelClass {
- GtkHBoxClass parent_class;
+ glHigHBoxClass parent_class;
void (*changed) (glWdgtRotateLabel * wdgt_rotate_label,
gpointer user_data);