From 48bdf0059de924880e20fc7641b7b5e6e33476dd Mon Sep 17 00:00:00 2001 From: Jim Evins Date: Thu, 20 Jun 2013 23:30:14 -0400 Subject: [PATCH] Add decoration to new label dialog. Manually added decorations back to new label dialog that have been deprecated in recent versions of Gtk. Still need to look for proper way to use theming information to select text and background colors. --- data/ui/new-label-dialog.ui | 235 ++++++++++++++++++++++++++++++++---- src/new-label-dialog.c | 18 ++- 2 files changed, 226 insertions(+), 27 deletions(-) diff --git a/data/ui/new-label-dialog.ui b/data/ui/new-label-dialog.ui index 3d276e17..a2d51f27 100644 --- a/data/ui/new-label-dialog.ui +++ b/data/ui/new-label-dialog.ui @@ -1,11 +1,12 @@ - - + + False True + False 6 18 @@ -15,23 +16,77 @@ True - 6 + False 12 + + + True + False + + + True + False + 6 + 3 + 13 + + + True + False + Select Product + + + + + + + + False + True + 0 + + + + + True + False + 1 + gtk-missing-image + + + True + True + 1 + + + + + + + False + False + 0 + + True + False + 3 + 3 0 Choose label or card product from hundreds of predefined templates or define your own. False False - 0 + 2 True + False @@ -39,7 +94,7 @@ True True - 1 + 3 @@ -47,6 +102,7 @@ True + False page 1 @@ -56,31 +112,85 @@ True - 6 + False 12 + + + True + False + + + True + False + 6 + 3 + 13 + + + True + False + Choose Orientation + + + + + + + + False + True + 0 + + + + + True + False + 1 + gtk-missing-image + + + True + True + 1 + + + + + + + False + False + 0 + + True + False 0 Select orientation of label content. False False - 0 + 2 True + False True True + False 12 True + False @@ -94,12 +204,14 @@ True + False Normal True True False + 0.5 True True @@ -126,10 +238,12 @@ True + False 12 True + False @@ -143,12 +257,14 @@ True + False Rotated True True False + 0.5 True normal_radio @@ -176,7 +292,7 @@ True False - 1 + 3 @@ -187,6 +303,7 @@ True + False page 2 @@ -197,30 +314,84 @@ True - 6 + False 12 + + + True + False + + + True + False + 6 + 3 + 13 + + + True + False + Review Selection + + + + + + + + False + True + 0 + + + + + True + False + 1 + gtk-missing-image + + + True + True + 1 + + + + + + + False + False + 0 + + True + False 0 Please review and confirm your selection. False False - 0 + 2 True + False 24 True + False True + False @@ -241,6 +412,7 @@ True + False 7 2 12 @@ -248,6 +420,7 @@ True + False 0 Description: @@ -255,12 +428,13 @@ 2 3 GTK_FILL - + True + False 0 Page size: @@ -268,12 +442,13 @@ 3 4 GTK_FILL - + True + False 0 Label size: @@ -281,12 +456,13 @@ 4 5 GTK_FILL - + True + False 0 Layout: @@ -294,12 +470,13 @@ 5 6 GTK_FILL - + True + False 0 0 Similar products: @@ -314,6 +491,7 @@ True + False 0 @@ -321,12 +499,13 @@ 2 2 3 - + True + False 0 @@ -334,12 +513,13 @@ 2 3 4 - + True + False 0 @@ -347,12 +527,13 @@ 2 4 5 - + True + False 0 @@ -360,23 +541,25 @@ 2 5 6 - + True + False 0 1 2 - + True + False 0 Part #: @@ -384,12 +567,13 @@ 1 2 GTK_FILL - + True + False 0 @@ -397,7 +581,7 @@ 2 1 2 - + @@ -406,15 +590,16 @@ True True never - automatic True + False queue etched-in True + False 0 0 1 @@ -436,12 +621,13 @@ True + False 0 Vendor: GTK_FILL - + @@ -455,7 +641,7 @@ True True - 1 + 3 @@ -466,6 +652,7 @@ True + False page 3 diff --git a/src/new-label-dialog.c b/src/new-label-dialog.c index be122b5a..308974f1 100644 --- a/src/new-label-dialog.c +++ b/src/new-label-dialog.c @@ -152,6 +152,9 @@ gl_new_label_dialog_class_init (glNewLabelDialogClass *class) static void gl_new_label_dialog_init (glNewLabelDialog *this) { + GdkRGBA banner_color = { 0, 0.5, 1.0, 1.0 }; + GtkWidget *page_1_banner_eventbox, *page_2_banner_eventbox, *page_3_banner_eventbox; + GtkWidget *page_1_image, *page_2_image, *page_3_image; gchar *logo_filename; GdkPixbuf *logo; GtkBuilder *builder; @@ -179,6 +182,12 @@ gl_new_label_dialog_init (glNewLabelDialog *this) } gl_builder_util_get_widgets (builder, + "page_1_banner_eventbox", &page_1_banner_eventbox, + "page_2_banner_eventbox", &page_2_banner_eventbox, + "page_3_banner_eventbox", &page_3_banner_eventbox, + "page_1_image", &page_1_image, + "page_2_image", &page_2_image, + "page_3_image", &page_3_image, "template_page_vbox", &this->priv->template_page_vbox, "combo_hbox", &this->priv->combo_hbox, "rotate_page_vbox", &this->priv->rotate_page_vbox, @@ -202,9 +211,10 @@ gl_new_label_dialog_init (glNewLabelDialog *this) gtk_assistant_append_page (GTK_ASSISTANT (this), this->priv->template_page_vbox); gtk_assistant_set_page_title (GTK_ASSISTANT (this), this->priv->template_page_vbox, _("Select Product")); gtk_assistant_set_page_type (GTK_ASSISTANT (this), this->priv->template_page_vbox, GTK_ASSISTANT_PAGE_INTRO); + gtk_widget_override_background_color (page_1_banner_eventbox, GTK_STATE_NORMAL, &banner_color); logo_filename = g_build_filename (GLABELS_DATA_DIR, "pixmaps", "new-select.png", NULL); logo = gdk_pixbuf_new_from_file (logo_filename, NULL); - gtk_assistant_set_page_header_image (GTK_ASSISTANT (this), this->priv->template_page_vbox, logo); + gtk_image_set_from_pixbuf (GTK_IMAGE (page_1_image), logo); g_free (logo_filename); g_object_unref (logo); @@ -214,9 +224,10 @@ gl_new_label_dialog_init (glNewLabelDialog *this) gtk_assistant_append_page (GTK_ASSISTANT (this), this->priv->rotate_page_vbox); gtk_assistant_set_page_title (GTK_ASSISTANT (this), this->priv->rotate_page_vbox, _("Choose Orientation")); gtk_assistant_set_page_complete (GTK_ASSISTANT (this), this->priv->rotate_page_vbox, TRUE); + gtk_widget_override_background_color (page_2_banner_eventbox, GTK_STATE_NORMAL, &banner_color); logo_filename = g_build_filename (GLABELS_DATA_DIR, "pixmaps", "new-rotate.png", NULL); logo = gdk_pixbuf_new_from_file (logo_filename, NULL); - gtk_assistant_set_page_header_image (GTK_ASSISTANT (this), this->priv->rotate_page_vbox, logo); + gtk_image_set_from_pixbuf (GTK_IMAGE (page_2_image), logo); g_free (logo_filename); g_object_unref (logo); @@ -229,9 +240,10 @@ gl_new_label_dialog_init (glNewLabelDialog *this) gtk_assistant_set_page_title (GTK_ASSISTANT (this), this->priv->confirm_page_vbox, _("Review")); gtk_assistant_set_page_type (GTK_ASSISTANT (this), this->priv->confirm_page_vbox, GTK_ASSISTANT_PAGE_CONFIRM); gtk_assistant_set_page_complete (GTK_ASSISTANT (this), this->priv->confirm_page_vbox, TRUE); + gtk_widget_override_background_color (page_3_banner_eventbox, GTK_STATE_NORMAL, &banner_color); logo_filename = g_build_filename (GLABELS_DATA_DIR, "pixmaps", "new-confirm.png", NULL); logo = gdk_pixbuf_new_from_file (logo_filename, NULL); - gtk_assistant_set_page_header_image (GTK_ASSISTANT (this), this->priv->confirm_page_vbox, logo); + gtk_image_set_from_pixbuf (GTK_IMAGE (page_3_image), logo); g_free (logo_filename); g_object_unref (logo); -- 2.39.5