[glabels] Add decoration to new label dialog.
- From: Jim Evins <jimevins src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glabels] Add decoration to new label dialog.
- Date: Fri, 21 Jun 2013 03:33:15 +0000 (UTC)
commit 48bdf0059de924880e20fc7641b7b5e6e33476dd
Author: Jim Evins <evins snaught com>
Date: Thu Jun 20 23:30:14 2013 -0400
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 3d276e1..a2d51f2 100644
--- a/data/ui/new-label-dialog.ui
+++ b/data/ui/new-label-dialog.ui
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
- <requires lib="gtk+" version="2.20"/>
- <!-- interface-naming-policy project-wide -->
+ <!-- interface-requires gtk+ 3.0 -->
<object class="GtkWindow" id="window1">
+ <property name="can_focus">False</property>
<child>
<object class="GtkHBox" id="new_label_dialog_hbox">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="spacing">18</property>
<child>
@@ -15,23 +16,77 @@
<child>
<object class="GtkVBox" id="template_page_vbox">
<property name="visible">True</property>
- <property name="border_width">6</property>
+ <property name="can_focus">False</property>
<property name="spacing">12</property>
<child>
+ <object class="GtkEventBox" id="page_1_banner_eventbox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkBox" id="page_1_banner_box">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">6</property>
+ <property name="margin_right">3</property>
+ <property name="spacing">13</property>
+ <child>
+ <object class="GtkLabel" id="label12">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Select Product</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ <attribute name="foreground" value="#ffffffffffff"/>
+ <attribute name="size" value="18000"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkImage" id="page_1_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
+ <property name="stock">gtk-missing-image</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkLabel" id="label19">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">3</property>
+ <property name="margin_right">3</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Choose label or card product from hundreds of
predefined templates or define your own.</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">0</property>
+ <property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="combo_hbox">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<child>
<placeholder/>
</child>
@@ -39,7 +94,7 @@
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
- <property name="position">1</property>
+ <property name="position">3</property>
</packing>
</child>
</object>
@@ -47,6 +102,7 @@
<child type="tab">
<object class="GtkLabel" id="label6">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label">page 1</property>
</object>
<packing>
@@ -56,31 +112,85 @@
<child>
<object class="GtkVBox" id="rotate_page_vbox">
<property name="visible">True</property>
- <property name="border_width">6</property>
+ <property name="can_focus">False</property>
<property name="spacing">12</property>
<child>
+ <object class="GtkEventBox" id="page_2_banner_eventbox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkBox" id="page_2_banner_box">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">6</property>
+ <property name="margin_right">3</property>
+ <property name="spacing">13</property>
+ <child>
+ <object class="GtkLabel" id="label13">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Choose Orientation</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ <attribute name="foreground" value="#ffffffffffff"/>
+ <attribute name="size" value="18000"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkImage" id="page_2_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
+ <property name="stock">gtk-missing-image</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkLabel" id="label10">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Select orientation of label content.</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">0</property>
+ <property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox2">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="spacing">12</property>
<child>
<object class="GtkHBox" id="normal_preview_hbox">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<child>
<placeholder/>
</child>
@@ -94,12 +204,14 @@
<child>
<object class="GtkHBox" id="hbox4">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<child>
<object class="GtkRadioButton" id="normal_radio">
<property name="label" translatable="yes">Normal</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
+ <property name="xalign">0.5</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
@@ -126,10 +238,12 @@
<child>
<object class="GtkVBox" id="vbox2">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="spacing">12</property>
<child>
<object class="GtkHBox" id="rotated_preview_hbox">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<child>
<placeholder/>
</child>
@@ -143,12 +257,14 @@
<child>
<object class="GtkHBox" id="hbox5">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<child>
<object class="GtkRadioButton" id="rotated_radio">
<property name="label" translatable="yes">Rotated</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
+ <property name="xalign">0.5</property>
<property name="draw_indicator">True</property>
<property name="group">normal_radio</property>
</object>
@@ -176,7 +292,7 @@
<packing>
<property name="expand">True</property>
<property name="fill">False</property>
- <property name="position">1</property>
+ <property name="position">3</property>
</packing>
</child>
</object>
@@ -187,6 +303,7 @@
<child type="tab">
<object class="GtkLabel" id="label9">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label">page 2</property>
</object>
<packing>
@@ -197,30 +314,84 @@
<child>
<object class="GtkVBox" id="confirm_page_vbox">
<property name="visible">True</property>
- <property name="border_width">6</property>
+ <property name="can_focus">False</property>
<property name="spacing">12</property>
<child>
+ <object class="GtkEventBox" id="page_3_banner_eventbox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkBox" id="page_3_banner_box">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">6</property>
+ <property name="margin_right">3</property>
+ <property name="spacing">13</property>
+ <child>
+ <object class="GtkLabel" id="label14">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Review Selection</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ <attribute name="foreground" value="#ffffffffffff"/>
+ <attribute name="size" value="18000"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkImage" id="page_3_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
+ <property name="stock">gtk-missing-image</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkLabel" id="label11">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Please review and confirm your
selection.</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">0</property>
+ <property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox3">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="spacing">24</property>
<child>
<object class="GtkVBox" id="vbox3">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<child>
<object class="GtkVBox" id="preview_vbox">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<child>
<placeholder/>
</child>
@@ -241,6 +412,7 @@
<child>
<object class="GtkTable" id="table1">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="n_rows">7</property>
<property name="n_columns">2</property>
<property name="column_spacing">12</property>
@@ -248,6 +420,7 @@
<child>
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Description:</property>
</object>
@@ -255,12 +428,13 @@
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Page size:</property>
</object>
@@ -268,12 +442,13 @@
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Label size:</property>
</object>
@@ -281,12 +456,13 @@
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkLabel" id="label4">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Layout:</property>
</object>
@@ -294,12 +470,13 @@
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
<property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkLabel" id="label7">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="label" translatable="yes">Similar products:</property>
@@ -314,6 +491,7 @@
<child>
<object class="GtkLabel" id="desc_label">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="xalign">0</property>
</object>
<packing>
@@ -321,12 +499,13 @@
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
- <property name="y_options"></property>
+ <property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkLabel" id="page_size_label">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="xalign">0</property>
</object>
<packing>
@@ -334,12 +513,13 @@
<property name="right_attach">2</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
- <property name="y_options"></property>
+ <property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_size_label">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="xalign">0</property>
</object>
<packing>
@@ -347,12 +527,13 @@
<property name="right_attach">2</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
- <property name="y_options"></property>
+ <property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkLabel" id="layout_label">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="xalign">0</property>
</object>
<packing>
@@ -360,23 +541,25 @@
<property name="right_attach">2</property>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
- <property name="y_options"></property>
+ <property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkLabel" id="vendor_label">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="y_options"></property>
+ <property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkLabel" id="label8">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Part #:</property>
</object>
@@ -384,12 +567,13 @@
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkLabel" id="part_label">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="xalign">0</property>
</object>
<packing>
@@ -397,7 +581,7 @@
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
- <property name="y_options"></property>
+ <property name="y_options"/>
</packing>
</child>
<child>
@@ -406,15 +590,16 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">never</property>
- <property name="vscrollbar_policy">automatic</property>
<child>
<object class="GtkViewport" id="viewport1">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="resize_mode">queue</property>
<property name="shadow_type">etched-in</property>
<child>
<object class="GtkLabel" id="similar_label">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="label">1
@@ -436,12 +621,13 @@
<child>
<object class="GtkLabel" id="label5">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Vendor:</property>
</object>
<packing>
<property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="y_options"/>
</packing>
</child>
</object>
@@ -455,7 +641,7 @@
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
- <property name="position">1</property>
+ <property name="position">3</property>
</packing>
</child>
</object>
@@ -466,6 +652,7 @@
<child type="tab">
<object class="GtkLabel" id="label18">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label">page 3</property>
</object>
<packing>
diff --git a/src/new-label-dialog.c b/src/new-label-dialog.c
index be122b5..308974f 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]