diff options
author | James Le Cuirot <chewi@aura-online.co.uk> | 2012-01-22 21:27:08 -0500 |
---|---|---|
committer | Jim Evins <evins@snaught.com> | 2012-01-22 21:27:08 -0500 |
commit | c821271c41201e099f1f1d491a926d1aea9c22c0 (patch) | |
tree | 801180e7286b87a2ba96919d6d7d233c0247f9dd | |
parent | 7734f6d7687226eec5b8a475d8c3519e276c24b7 (diff) |
New text vertical alignment feature.
Adds vertical alignment feature for text objects.
Added appropriate icons (evins@snaught.com).
22 files changed, 975 insertions, 124 deletions
diff --git a/data/icons/22x22/Makefile.am b/data/icons/22x22/Makefile.am index 955d860..1587bb6 100644 --- a/data/icons/22x22/Makefile.am +++ b/data/icons/22x22/Makefile.am @@ -1,11 +1,18 @@ size = 22x22 appiconsdir = $(datadir)/icons/hicolor/$(size)/apps +actioniconsdir = $(datadir)/$(GLABELS_BRANCH)/icons/hicolor/$(size)/actions appicons_DATA = \ apps/glabels-3.0.png +actionicons_DATA = \ + actions/glabels-align-text-bottom.png \ + actions/glabels-align-text-middle.png \ + actions/glabels-align-text-top.png + noinst_DATA = -EXTRA_DIST = $(appicons_DATA) \ +EXTRA_DIST = $(appicons_DATA) \ + $(actionicons_DATA) \ $(noinst_DATA) diff --git a/data/icons/22x22/actions/glabels-align-text-bottom.png b/data/icons/22x22/actions/glabels-align-text-bottom.png Binary files differnew file mode 100644 index 0000000..a9586f9 --- /dev/null +++ b/data/icons/22x22/actions/glabels-align-text-bottom.png diff --git a/data/icons/22x22/actions/glabels-align-text-middle.png b/data/icons/22x22/actions/glabels-align-text-middle.png Binary files differnew file mode 100644 index 0000000..2de6342 --- /dev/null +++ b/data/icons/22x22/actions/glabels-align-text-middle.png diff --git a/data/icons/22x22/actions/glabels-align-text-top.png b/data/icons/22x22/actions/glabels-align-text-top.png Binary files differnew file mode 100644 index 0000000..fda4420 --- /dev/null +++ b/data/icons/22x22/actions/glabels-align-text-top.png diff --git a/data/icons/24x24/Makefile.am b/data/icons/24x24/Makefile.am index 4dd62a0..4af195e 100644 --- a/data/icons/24x24/Makefile.am +++ b/data/icons/24x24/Makefile.am @@ -7,6 +7,9 @@ appicons_DATA = \ apps/glabels-3.0.png actionicons_DATA = \ + actions/glabels-align-text-bottom.png \ + actions/glabels-align-text-middle.png \ + actions/glabels-align-text-top.png \ actions/glabels-arrow.png \ actions/glabels-barcode.png \ actions/glabels-box.png \ diff --git a/data/icons/24x24/actions/glabels-align-text-bottom.png b/data/icons/24x24/actions/glabels-align-text-bottom.png Binary files differnew file mode 100644 index 0000000..5dbc037 --- /dev/null +++ b/data/icons/24x24/actions/glabels-align-text-bottom.png diff --git a/data/icons/24x24/actions/glabels-align-text-middle.png b/data/icons/24x24/actions/glabels-align-text-middle.png Binary files differnew file mode 100644 index 0000000..33220ca --- /dev/null +++ b/data/icons/24x24/actions/glabels-align-text-middle.png diff --git a/data/icons/24x24/actions/glabels-align-text-top.png b/data/icons/24x24/actions/glabels-align-text-top.png Binary files differnew file mode 100644 index 0000000..2ece60d --- /dev/null +++ b/data/icons/24x24/actions/glabels-align-text-top.png diff --git a/data/ui/object-editor.ui b/data/ui/object-editor.ui index 582a19e..422bcca 100644 --- a/data/ui/object-editor.ui +++ b/data/ui/object-editor.ui @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <interface> <requires lib="gtk+" version="2.20"/> - <!-- interface-naming-policy toplevel-contextual --> <object class="GtkAdjustment" id="adjustment1"> <property name="lower">1</property> <property name="upper">250</property> @@ -9,6 +8,29 @@ <property name="step_increment">1</property> <property name="page_increment">10</property> </object> + <object class="GtkAdjustment" id="adjustment10"> + <property name="upper">100</property> + <property name="step_increment">0.01</property> + <property name="page_increment">1</property> + </object> + <object class="GtkAdjustment" id="adjustment11"> + <property name="upper">100</property> + <property name="step_increment">0.01</property> + <property name="page_increment">1</property> + </object> + <object class="GtkAdjustment" id="adjustment12"> + <property name="upper">100</property> + <property name="value">1</property> + <property name="step_increment">1</property> + <property name="page_increment">10</property> + </object> + <object class="GtkAdjustment" id="adjustment13"> + <property name="lower">1</property> + <property name="upper">100</property> + <property name="value">1</property> + <property name="step_increment">1</property> + <property name="page_increment">10</property> + </object> <object class="GtkAdjustment" id="adjustment2"> <property name="upper">5</property> <property name="value">1</property> @@ -56,70 +78,60 @@ <property name="step_increment">0.01</property> <property name="page_increment">1</property> </object> - <object class="GtkAdjustment" id="adjustment10"> - <property name="upper">100</property> - <property name="step_increment">0.01</property> - <property name="page_increment">1</property> - </object> - <object class="GtkAdjustment" id="adjustment11"> - <property name="upper">100</property> - <property name="step_increment">0.01</property> - <property name="page_increment">1</property> - </object> - <object class="GtkAdjustment" id="adjustment12"> - <property name="upper">100</property> - <property name="value">1</property> - <property name="step_increment">1</property> - <property name="page_increment">10</property> - </object> - <object class="GtkAdjustment" id="adjustment13"> - <property name="lower">1</property> - <property name="upper">100</property> - <property name="value">1</property> - <property name="step_increment">1</property> - <property name="page_increment">10</property> - </object> - <object class="GtkSizeGroup" id="page_sizegroup"> - <property name="mode">both</property> - <widgets> - <widget name="shadow_page_vbox"/> - <widget name="lsize_page_vbox"/> - <widget name="size_page_vbox"/> - <widget name="bc_page_vbox"/> - <widget name="data_page_vbox"/> - <widget name="img_page_vbox"/> - <widget name="fill_page_vbox"/> - <widget name="line_page_vbox"/> - <widget name="text_page_vbox"/> - <widget name="edit_page_vbox"/> - </widgets> - </object> - <object class="GtkSizeGroup" id="width_sizegroup"> - <widgets> - <widget name="notebook"/> - <widget name="title_hbox"/> - </widgets> - </object> <object class="GtkDialog" id="dialog"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="border_width">6</property> <property name="title" translatable="yes">dialog1</property> <property name="type_hint">dialog</property> <child internal-child="vbox"> - <object class="GtkVBox" id="dialog-vbox1"> + <object class="GtkBox" id="dialog-vbox1"> <property name="visible">True</property> + <property name="can_focus">False</property> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="closebutton1"> + <property name="label">gtk-close</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> <child> <object class="GtkVBox" id="editor_vbox"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="border_width">6</property> <property name="spacing">12</property> <child> <object class="GtkHBox" id="title_hbox"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <object class="GtkImage" id="title_image"> <property name="visible">True</property> + <property name="can_focus">False</property> </object> <packing> <property name="expand">False</property> @@ -130,6 +142,7 @@ <child> <object class="GtkLabel" id="title_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label"><span weight="bold" size="larger">Xxx object properties</span></property> <property name="use_markup">True</property> </object> @@ -154,11 +167,13 @@ <child> <object class="GtkVBox" id="edit_page_vbox"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="border_width">12</property> <property name="spacing">6</property> <child> <object class="GtkHBox" id="hbox30"> <property name="visible">True</property> + <property name="can_focus">False</property> <child> <object class="GtkScrolledWindow" id="scrolledwindow1"> <property name="visible">True</property> @@ -187,10 +202,12 @@ <child> <object class="GtkHBox" id="hbox1"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <object class="GtkVBox" id="edit_insert_field_vbox"> <property name="visible">True</property> + <property name="can_focus">False</property> <child> <placeholder/> </child> @@ -216,6 +233,7 @@ <child type="tab"> <object class="GtkLabel" id="edit_tab_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label" translatable="yes">Text</property> </object> <packing> @@ -225,15 +243,18 @@ <child> <object class="GtkVBox" id="text_page_vbox"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="border_width">12</property> <property name="spacing">12</property> <child> <object class="GtkHBox" id="hbox65"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <object class="GtkLabel" id="text_family_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">Family:</property> </object> @@ -246,6 +267,7 @@ <child> <object class="GtkHBox" id="text_family_hbox"> <property name="visible">True</property> + <property name="can_focus">False</property> <child> <placeholder/> </child> @@ -266,10 +288,12 @@ <child> <object class="GtkHBox" id="hbox66"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <object class="GtkLabel" id="text_size_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">Size:</property> </object> @@ -282,6 +306,7 @@ <child> <object class="GtkHBox" id="hbox28"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <object class="GtkSpinButton" id="text_size_spin"> @@ -314,10 +339,12 @@ <child> <object class="GtkHBox" id="hbox67"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <object class="GtkLabel" id="text_style_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">Style:</property> </object> @@ -330,15 +357,18 @@ <child> <object class="GtkHBox" id="hbox29"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <object class="GtkToggleButton" id="text_bold_toggle"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> <child> <object class="GtkImage" id="image1"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="stock">gtk-bold</property> </object> </child> @@ -354,9 +384,11 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> <child> <object class="GtkImage" id="image2"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="stock">gtk-italic</property> </object> </child> @@ -384,10 +416,12 @@ <child> <object class="GtkHBox" id="hbox68"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <object class="GtkLabel" id="text_color_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="yalign">0.14000000059604645</property> <property name="label" translatable="yes">Color:</property> @@ -401,10 +435,12 @@ <child> <object class="GtkVBox" id="vbox3"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">6</property> <child> <object class="GtkHBox" id="hbox42"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">6</property> <child> <object class="GtkRadioButton" id="text_color_radio"> @@ -412,6 +448,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="focus_on_click">False</property> <property name="draw_indicator">True</property> @@ -425,6 +462,7 @@ <child> <object class="GtkHBox" id="text_color_hbox"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <placeholder/> @@ -446,6 +484,7 @@ <child> <object class="GtkHBox" id="hbox44"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">6</property> <child> <object class="GtkRadioButton" id="text_color_key_radio"> @@ -453,6 +492,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="focus_on_click">False</property> <property name="xalign">0.54000002145767212</property> @@ -468,6 +508,7 @@ <child> <object class="GtkHBox" id="text_color_key_hbox"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <placeholder/> @@ -503,10 +544,12 @@ <child> <object class="GtkHBox" id="hbox69"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <object class="GtkLabel" id="text_align_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">Alignment:</property> </object> @@ -519,15 +562,18 @@ <child> <object class="GtkHBox" id="hbox4"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <object class="GtkToggleButton" id="text_left_toggle"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> <child> <object class="GtkImage" id="image3"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="stock">gtk-justify-left</property> </object> </child> @@ -543,9 +589,11 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> <child> <object class="GtkImage" id="image4"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="stock">gtk-justify-center</property> </object> </child> @@ -561,9 +609,11 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> <child> <object class="GtkImage" id="image5"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="stock">gtk-justify-right</property> </object> </child> @@ -589,12 +639,115 @@ </packing> </child> <child> + <object class="GtkHBox" id="hbox69v"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="spacing">12</property> + <child> + <object class="GtkLabel" id="text_valign_label"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Vertical alignment:</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkHBox" id="hbox4v"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="spacing">12</property> + <child> + <object class="GtkToggleButton" id="text_top_toggle"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <child> + <object class="GtkImage" id="image3v"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="pixel_size">22</property> + <property name="icon_name">glabels-align-text-top</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkToggleButton" id="text_vcenter_toggle"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0.47999998927116394</property> + <child> + <object class="GtkImage" id="image4v"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="pixel_size">22</property> + <property name="icon_name">glabels-align-text-middle</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkToggleButton" id="text_bottom_toggle"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <child> + <object class="GtkImage" id="image5v"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="pixel_size">22</property> + <property name="icon_name">glabels-align-text-bottom</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">2</property> + </packing> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">5</property> + </packing> + </child> + <child> <object class="GtkHBox" id="hbox70"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <object class="GtkLabel" id="text_line_spacing_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">Line Spacing:</property> </object> @@ -607,6 +760,7 @@ <child> <object class="GtkHBox" id="hbox31"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <object class="GtkSpinButton" id="text_line_spacing_spin"> @@ -633,7 +787,7 @@ <packing> <property name="expand">False</property> <property name="fill">False</property> - <property name="position">5</property> + <property name="position">6</property> </packing> </child> <child> @@ -642,13 +796,14 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="draw_indicator">True</property> </object> <packing> <property name="expand">False</property> <property name="fill">False</property> - <property name="position">6</property> + <property name="position">7</property> </packing> </child> </object> @@ -660,6 +815,7 @@ <child type="tab"> <object class="GtkLabel" id="text_tab_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0.46000000834465027</property> <property name="label" translatable="yes">Style</property> </object> @@ -671,15 +827,18 @@ <child> <object class="GtkVBox" id="line_page_vbox"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="border_width">12</property> <property name="spacing">12</property> <child> <object class="GtkHBox" id="hbox71"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <object class="GtkLabel" id="line_w_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">Width:</property> </object> @@ -692,6 +851,7 @@ <child> <object class="GtkHBox" id="hbox7"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <object class="GtkSpinButton" id="line_width_spin"> @@ -711,6 +871,7 @@ <child> <object class="GtkLabel" id="label21"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label" translatable="yes">points</property> </object> <packing> @@ -736,10 +897,12 @@ <child> <object class="GtkHBox" id="hbox72"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <object class="GtkLabel" id="line_color_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="yalign">0.14000000059604645</property> <property name="label" translatable="yes">Color:</property> @@ -753,11 +916,12 @@ <child> <object class="GtkVBox" id="vbox2"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">6</property> - <property name="vexpand">False</property> <child> <object class="GtkHBox" id="hbox38"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">6</property> <child> <object class="GtkRadioButton" id="line_color_radio"> @@ -765,6 +929,7 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="focus_on_click">False</property> <property name="draw_indicator">True</property> @@ -778,6 +943,7 @@ <child> <object class="GtkHBox" id="line_color_hbox"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <placeholder/> @@ -799,6 +965,7 @@ <child> <object class="GtkHBox" id="hbox40"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">6</property> <child> <object class="GtkRadioButton" id="line_key_radio"> @@ -806,6 +973,7 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="focus_on_click">False</property> <property name="draw_indicator">True</property> @@ -820,6 +988,7 @@ <child> <object class="GtkHBox" id="line_key_hbox"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <placeholder/> @@ -860,6 +1029,7 @@ <child type="tab"> <object class="GtkLabel" id="line_tab_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label" translatable="yes">Line</property> </object> <packing> @@ -870,15 +1040,17 @@ <child> <object class="GtkVBox" id="fill_page_vbox"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="border_width">12</property> <child> <object class="GtkHBox" id="hbox73"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> - <property name="vexpand">False</property> <child> <object class="GtkLabel" id="fill_color_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="yalign">0.14000000059604645</property> <property name="label" translatable="yes">Color:</property> @@ -892,10 +1064,12 @@ <child> <object class="GtkVBox" id="vbox5"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">6</property> <child> <object class="GtkHBox" id="hbox50"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">6</property> <child> <object class="GtkRadioButton" id="fill_color_radio"> @@ -903,6 +1077,7 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="focus_on_click">False</property> <property name="active">True</property> @@ -917,6 +1092,7 @@ <child> <object class="GtkHBox" id="fill_color_hbox"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <placeholder/> @@ -938,6 +1114,7 @@ <child> <object class="GtkHBox" id="hbox52"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">6</property> <child> <object class="GtkRadioButton" id="fill_key_radio"> @@ -945,6 +1122,7 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="focus_on_click">False</property> <property name="draw_indicator">True</property> @@ -959,6 +1137,7 @@ <child> <object class="GtkHBox" id="fill_key_hbox"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <placeholder/> @@ -999,6 +1178,7 @@ <child type="tab"> <object class="GtkLabel" id="fill_tab_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label" translatable="yes">Fill</property> </object> <packing> @@ -1009,11 +1189,13 @@ <child> <object class="GtkVBox" id="img_page_vbox"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="border_width">12</property> <property name="spacing">12</property> <child> <object class="GtkHBox" id="hbox74"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <object class="GtkRadioButton" id="img_file_radio"> @@ -1021,6 +1203,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="focus_on_click">False</property> <property name="draw_indicator">True</property> @@ -1034,6 +1217,7 @@ <child> <object class="GtkFileChooserButton" id="img_file_button"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="show_hidden">True</property> </object> <packing> @@ -1052,6 +1236,7 @@ <child> <object class="GtkHBox" id="hbox75"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <object class="GtkRadioButton" id="img_key_radio"> @@ -1060,6 +1245,7 @@ <property name="sensitive">False</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="focus_on_click">False</property> <property name="draw_indicator">True</property> @@ -1074,6 +1260,7 @@ <child> <object class="GtkHBox" id="img_key_hbox"> <property name="visible">True</property> + <property name="can_focus">False</property> <child> <placeholder/> </child> @@ -1099,6 +1286,7 @@ <child type="tab"> <object class="GtkLabel" id="img_tab_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label" translatable="yes">Image</property> </object> <packing> @@ -1109,11 +1297,13 @@ <child> <object class="GtkVBox" id="data_page_vbox"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="border_width">12</property> <property name="spacing">12</property> <child> <object class="GtkHBox" id="hbox76"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <object class="GtkRadioButton" id="data_literal_radio"> @@ -1121,6 +1311,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="draw_indicator">True</property> </object> @@ -1151,6 +1342,7 @@ <child> <object class="GtkHBox" id="hbox77"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <object class="GtkRadioButton" id="data_key_radio"> @@ -1158,6 +1350,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="draw_indicator">True</property> <property name="group">data_literal_radio</property> @@ -1171,6 +1364,7 @@ <child> <object class="GtkHBox" id="data_key_hbox"> <property name="visible">True</property> + <property name="can_focus">False</property> <child> <placeholder/> </child> @@ -1191,10 +1385,12 @@ <child> <object class="GtkHBox" id="hbox78"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <object class="GtkLabel" id="data_fill_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label"> </property> </object> <packing> @@ -1206,6 +1402,7 @@ <child> <object class="GtkTable" id="table9"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="n_rows">2</property> <property name="n_columns">2</property> <property name="column_spacing">6</property> @@ -1213,6 +1410,7 @@ <child> <object class="GtkLabel" id="data_format_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">format:</property> </object> @@ -1224,6 +1422,7 @@ <child> <object class="GtkLabel" id="data_ex_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label">00000000000 00000</property> </object> @@ -1237,6 +1436,7 @@ <child> <object class="GtkLabel" id="data_digits_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">digits:</property> </object> @@ -1250,6 +1450,7 @@ <child> <object class="GtkHBox" id="hbox32"> <property name="visible">True</property> + <property name="can_focus">False</property> <child> <object class="GtkSpinButton" id="data_digits_spin"> <property name="visible">True</property> @@ -1296,6 +1497,7 @@ <child type="tab"> <object class="GtkLabel" id="data_tab_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label" translatable="yes">Data</property> </object> <packing> @@ -1306,19 +1508,21 @@ <child> <object class="GtkVBox" id="bc_page_vbox"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="border_width">12</property> <property name="spacing">12</property> <child> <object class="GtkTable" id="table1"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="n_rows">2</property> <property name="n_columns">2</property> <property name="column_spacing">6</property> <property name="row_spacing">6</property> - <property name="vexpand">False</property> <child> <object class="GtkLabel" id="bc_be_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">Backend:</property> </object> @@ -1330,6 +1534,7 @@ <child> <object class="GtkLabel" id="bc_style_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">Style:</property> </object> @@ -1343,6 +1548,7 @@ <child> <object class="GtkHBox" id="bc_backend_combo_hbox"> <property name="visible">True</property> + <property name="can_focus">False</property> <child> <placeholder/> </child> @@ -1355,6 +1561,7 @@ <child> <object class="GtkHBox" id="bc_style_combo_hbox"> <property name="visible">True</property> + <property name="can_focus">False</property> <child> <placeholder/> </child> @@ -1379,6 +1586,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="draw_indicator">True</property> </object> @@ -1394,6 +1602,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="draw_indicator">True</property> </object> @@ -1406,11 +1615,12 @@ <child> <object class="GtkHBox" id="hbox80"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> - <property name="vexpand">False</property> <child> <object class="GtkLabel" id="bc_color_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="yalign">0.14000000059604645</property> <property name="label" translatable="yes">Color:</property> @@ -1424,10 +1634,12 @@ <child> <object class="GtkVBox" id="vbox4"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">6</property> <child> <object class="GtkHBox" id="hbox46"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">6</property> <child> <object class="GtkRadioButton" id="bc_color_radio"> @@ -1435,6 +1647,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="focus_on_click">False</property> <property name="active">True</property> @@ -1449,6 +1662,7 @@ <child> <object class="GtkHBox" id="bc_color_hbox"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <placeholder/> @@ -1470,6 +1684,7 @@ <child> <object class="GtkHBox" id="hbox48"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">6</property> <child> <object class="GtkRadioButton" id="bc_key_radio"> @@ -1477,6 +1692,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="focus_on_click">False</property> <property name="draw_indicator">True</property> @@ -1491,6 +1707,7 @@ <child> <object class="GtkHBox" id="bc_key_hbox"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <placeholder/> @@ -1531,6 +1748,7 @@ <child type="tab"> <object class="GtkLabel" id="bc_tab_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label" translatable="yes">Style</property> </object> <packing> @@ -1541,11 +1759,13 @@ <child> <object class="GtkVBox" id="size_page_vbox"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="border_width">12</property> <property name="spacing">12</property> <child> <object class="GtkTable" id="table6"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="n_rows">3</property> <property name="n_columns">3</property> <property name="column_spacing">12</property> @@ -1553,6 +1773,7 @@ <child> <object class="GtkLabel" id="size_w_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">Width:</property> </object> @@ -1564,6 +1785,7 @@ <child> <object class="GtkLabel" id="size_h_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">Height:</property> </object> @@ -1577,6 +1799,7 @@ <child> <object class="GtkHBox" id="hbox11"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <object class="GtkSpinButton" id="size_h_spin"> @@ -1597,6 +1820,7 @@ <child> <object class="GtkLabel" id="size_h_units_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label" translatable="yes">inches</property> </object> <packing> @@ -1618,6 +1842,7 @@ <child> <object class="GtkHBox" id="hbox13"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <object class="GtkButton" id="size_reset_image_button"> @@ -1625,6 +1850,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> <property name="use_underline">True</property> </object> <packing> @@ -1645,6 +1871,7 @@ <child> <object class="GtkHBox" id="hbox10"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <object class="GtkSpinButton" id="size_w_spin"> @@ -1665,6 +1892,7 @@ <child> <object class="GtkLabel" id="size_w_units_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label" translatable="yes">inches</property> </object> <packing> @@ -1684,6 +1912,7 @@ <child> <object class="GtkVBox" id="size_aspect_vbox"> <property name="visible">True</property> + <property name="can_focus">False</property> <child> <placeholder/> </child> @@ -1714,6 +1943,7 @@ <child type="tab"> <object class="GtkLabel" id="size_tab_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label" translatable="yes">Size</property> </object> <packing> @@ -1724,11 +1954,13 @@ <child> <object class="GtkVBox" id="lsize_page_vbox"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="border_width">12</property> <property name="spacing">12</property> <child> <object class="GtkTable" id="table7"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="n_rows">2</property> <property name="n_columns">2</property> <property name="column_spacing">12</property> @@ -1736,6 +1968,7 @@ <child> <object class="GtkLabel" id="lsize_r_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">Length:</property> </object> @@ -1747,6 +1980,7 @@ <child> <object class="GtkLabel" id="lsize_theta_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">Angle:</property> </object> @@ -1760,6 +1994,7 @@ <child> <object class="GtkHBox" id="hbox25"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <object class="GtkSpinButton" id="lsize_r_spin"> @@ -1780,6 +2015,7 @@ <child> <object class="GtkLabel" id="lsize_r_units_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label" translatable="yes">inches</property> </object> <packing> @@ -1798,6 +2034,7 @@ <child> <object class="GtkHBox" id="hbox26"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <object class="GtkSpinButton" id="lsize_theta_spin"> @@ -1818,6 +2055,7 @@ <child> <object class="GtkLabel" id="label38"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label" translatable="yes">degrees</property> </object> <packing> @@ -1851,6 +2089,7 @@ <child type="tab"> <object class="GtkLabel" id="lsize_tab_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label" translatable="yes">Size</property> </object> <packing> @@ -1861,11 +2100,13 @@ <child> <object class="GtkVBox" id="pos_page_vbox"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="border_width">12</property> <property name="spacing">12</property> <child> <object class="GtkTable" id="table8"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="n_rows">2</property> <property name="n_columns">3</property> <property name="column_spacing">12</property> @@ -1874,6 +2115,7 @@ <object class="GtkLabel" id="pos_x_label"> <property name="width_request">50</property> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">X:</property> </object> @@ -1885,6 +2127,7 @@ <child> <object class="GtkLabel" id="pos_y_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">Y:</property> </object> @@ -1898,6 +2141,7 @@ <child> <object class="GtkLabel" id="pos_x_units_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">inches</property> </object> @@ -1911,6 +2155,7 @@ <child> <object class="GtkLabel" id="pos_y_units_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">inches</property> </object> @@ -1974,6 +2219,7 @@ <child type="tab"> <object class="GtkLabel" id="pos_tab_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label" translatable="yes">Position</property> </object> <packing> @@ -1984,6 +2230,7 @@ <child> <object class="GtkVBox" id="shadow_page_vbox"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="border_width">12</property> <property name="spacing">12</property> <child> @@ -1992,6 +2239,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="draw_indicator">True</property> </object> @@ -2004,15 +2252,17 @@ <child> <object class="GtkVBox" id="shadow_controls_table"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> - <property name="vexpand">False</property> <child> <object class="GtkHBox" id="hbox63"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <object class="GtkLabel" id="label40"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">X Offset:</property> </object> @@ -2025,6 +2275,7 @@ <child> <object class="GtkHBox" id="hbox54"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <object class="GtkSpinButton" id="shadow_x_spin"> @@ -2045,6 +2296,7 @@ <child> <object class="GtkLabel" id="shadow_x_units_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label" translatable="yes">inches</property> </object> <packing> @@ -2070,10 +2322,12 @@ <child> <object class="GtkHBox" id="hbox64"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <object class="GtkLabel" id="label41"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">Y Offset:</property> </object> @@ -2086,6 +2340,7 @@ <child> <object class="GtkHBox" id="hbox55"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <object class="GtkSpinButton" id="shadow_y_spin"> @@ -2106,6 +2361,7 @@ <child> <object class="GtkLabel" id="shadow_y_units_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label" translatable="yes">inches</property> </object> <packing> @@ -2131,10 +2387,12 @@ <child> <object class="GtkHBox" id="hbox61"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <object class="GtkLabel" id="label45"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="yalign">0.14000000059604645</property> <property name="label" translatable="yes">Color:</property> @@ -2148,10 +2406,12 @@ <child> <object class="GtkVBox" id="vbox7"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">6</property> <child> <object class="GtkHBox" id="hbox57"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">6</property> <child> <object class="GtkRadioButton" id="shadow_color_radio"> @@ -2159,6 +2419,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="focus_on_click">False</property> <property name="draw_indicator">True</property> @@ -2172,6 +2433,7 @@ <child> <object class="GtkHBox" id="shadow_color_hbox"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <placeholder/> @@ -2193,6 +2455,7 @@ <child> <object class="GtkHBox" id="hbox59"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">6</property> <child> <object class="GtkRadioButton" id="shadow_key_radio"> @@ -2200,6 +2463,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="focus_on_click">False</property> <property name="draw_indicator">True</property> @@ -2214,6 +2478,7 @@ <child> <object class="GtkHBox" id="shadow_key_hbox"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <placeholder/> @@ -2249,10 +2514,12 @@ <child> <object class="GtkHBox" id="hbox62"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <object class="GtkLabel" id="label46"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">Opacity:</property> </object> @@ -2265,6 +2532,7 @@ <child> <object class="GtkHBox" id="hbox56"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <object class="GtkSpinButton" id="shadow_opacity_spin"> @@ -2282,6 +2550,7 @@ <child> <object class="GtkLabel" id="label47"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label" translatable="yes">%</property> </object> <packing> @@ -2319,6 +2588,7 @@ <child type="tab"> <object class="GtkLabel" id="shadow_tab_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label" translatable="yes">Shadow</property> </object> <packing> @@ -2340,37 +2610,31 @@ <property name="position">2</property> </packing> </child> - <child internal-child="action_area"> - <object class="GtkHButtonBox" id="dialog-action_area1"> - <property name="visible">True</property> - <property name="layout_style">end</property> - <child> - <object class="GtkButton" id="closebutton1"> - <property name="label">gtk-close</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">False</property> - <property name="use_stock">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="pack_type">end</property> - <property name="position">0</property> - </packing> - </child> </object> </child> <action-widgets> <action-widget response="-7">closebutton1</action-widget> </action-widgets> </object> + <object class="GtkSizeGroup" id="page_sizegroup"> + <property name="mode">both</property> + <widgets> + <widget name="shadow_page_vbox"/> + <widget name="lsize_page_vbox"/> + <widget name="size_page_vbox"/> + <widget name="bc_page_vbox"/> + <widget name="data_page_vbox"/> + <widget name="img_page_vbox"/> + <widget name="fill_page_vbox"/> + <widget name="line_page_vbox"/> + <widget name="text_page_vbox"/> + <widget name="edit_page_vbox"/> + </widgets> + </object> + <object class="GtkSizeGroup" id="width_sizegroup"> + <widgets> + <widget name="notebook"/> + <widget name="title_hbox"/> + </widgets> + </object> </interface> diff --git a/data/ui/property-bar.ui b/data/ui/property-bar.ui index 0d3914a..2bb07e6 100644 --- a/data/ui/property-bar.ui +++ b/data/ui/property-bar.ui @@ -1,14 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <interface> <requires lib="gtk+" version="2.20"/> - <!-- interface-naming-policy toplevel-contextual --> - <object class="GtkAdjustment" id="adjustment2"> - <property name="lower">0.25</property> - <property name="upper">4</property> - <property name="value">1</property> - <property name="step_increment">0.25</property> - <property name="page_increment">1</property> - </object> <object class="GtkAdjustment" id="adjustment1"> <property name="lower">1</property> <property name="upper">250</property> @@ -16,20 +8,32 @@ <property name="step_increment">1</property> <property name="page_increment">10</property> </object> + <object class="GtkAdjustment" id="adjustment2"> + <property name="lower">0.25</property> + <property name="upper">4</property> + <property name="value">1</property> + <property name="step_increment">0.25</property> + <property name="page_increment">1</property> + </object> <object class="GtkWindow" id="window1"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="title" translatable="yes">window1</property> <child> <object class="GtkToolbar" id="property_toolbar"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="toolbar_style">icons</property> <property name="show_arrow">False</property> <child> <object class="GtkToolItem" id="toolitem1"> <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="use_action_appearance">False</property> <child> <object class="GtkEventBox" id="font_family_eventbox"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="tooltip_text" translatable="yes">Font family</property> <property name="visible_window">False</property> <child> @@ -45,9 +49,12 @@ <child> <object class="GtkToolItem" id="toolitem2"> <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="use_action_appearance">False</property> <child> <object class="GtkAlignment" id="alignment1"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="left_padding">6</property> <child> <object class="GtkSpinButton" id="font_size_spin"> @@ -68,6 +75,7 @@ <child> <object class="GtkSeparatorToolItem" id="separatortoolitem1"> <property name="visible">True</property> + <property name="can_focus">False</property> </object> <packing> <property name="expand">False</property> @@ -76,7 +84,9 @@ <child> <object class="GtkToggleToolButton" id="font_bold_toggle"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="tooltip_text" translatable="yes">Bold</property> + <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="stock_id">gtk-bold</property> </object> @@ -88,7 +98,9 @@ <child> <object class="GtkToggleToolButton" id="font_italic_toggle"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="tooltip_text" translatable="yes">Italic</property> + <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="stock_id">gtk-italic</property> </object> @@ -100,6 +112,7 @@ <child> <object class="GtkSeparatorToolItem" id="separatortoolitem2"> <property name="visible">True</property> + <property name="can_focus">False</property> </object> <packing> <property name="expand">False</property> @@ -108,7 +121,9 @@ <child> <object class="GtkRadioToolButton" id="text_align_left_radio"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="tooltip_text" translatable="yes">Left align</property> + <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="stock_id">gtk-justify-left</property> </object> @@ -120,7 +135,9 @@ <child> <object class="GtkRadioToolButton" id="text_align_center_radio"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="tooltip_text" translatable="yes">Center align</property> + <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="stock_id">gtk-justify-center</property> <property name="group">text_align_left_radio</property> @@ -133,7 +150,9 @@ <child> <object class="GtkRadioToolButton" id="text_align_right_radio"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="tooltip_text" translatable="yes">Right align</property> + <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="stock_id">gtk-justify-right</property> <property name="group">text_align_left_radio</property> @@ -146,6 +165,60 @@ <child> <object class="GtkSeparatorToolItem" id="separatortoolitem3"> <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="expand">False</property> + </packing> + </child> + <child> + <object class="GtkRadioToolButton" id="text_valign_top_radio"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Top vertical align</property> + <property name="use_action_appearance">False</property> + <property name="use_underline">True</property> + <property name="icon_name">glabels-align-text-top</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkRadioToolButton" id="text_valign_vcenter_radio"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Center vertical align</property> + <property name="use_action_appearance">False</property> + <property name="use_underline">True</property> + <property name="icon_name">glabels-align-text-middle</property> + <property name="group">text_valign_top_radio</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkRadioToolButton" id="text_valign_bottom_radio"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Bottom vertical align</property> + <property name="use_action_appearance">False</property> + <property name="use_underline">True</property> + <property name="icon_name">glabels-align-text-bottom</property> + <property name="group">text_valign_top_radio</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkSeparatorToolItem" id="separatortoolitem4"> + <property name="visible">True</property> + <property name="can_focus">False</property> </object> <packing> <property name="expand">False</property> @@ -154,9 +227,12 @@ <child> <object class="GtkToolItem" id="toolitem3"> <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="use_action_appearance">False</property> <child> <object class="GtkEventBox" id="text_color_eventbox"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="tooltip_text" translatable="yes">Text color</property> <property name="visible_window">False</property> <child> @@ -172,9 +248,12 @@ <child> <object class="GtkToolItem" id="toolitem4"> <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="use_action_appearance">False</property> <child> <object class="GtkEventBox" id="fill_color_eventbox"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="tooltip_text" translatable="yes">Fill color</property> <property name="visible_window">False</property> <child> @@ -190,9 +269,12 @@ <child> <object class="GtkToolItem" id="toolitem5"> <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="use_action_appearance">False</property> <child> <object class="GtkEventBox" id="line_color_eventbox"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="tooltip_text" translatable="yes">Line color</property> <property name="visible_window">False</property> <child> @@ -206,8 +288,9 @@ </packing> </child> <child> - <object class="GtkSeparatorToolItem" id="separatortoolitem4"> + <object class="GtkSeparatorToolItem" id="separatortoolitem5"> <property name="visible">True</property> + <property name="can_focus">False</property> </object> <packing> <property name="expand">False</property> @@ -216,6 +299,8 @@ <child> <object class="GtkToolItem" id="toolitem6"> <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="use_action_appearance">False</property> <child> <object class="GtkSpinButton" id="line_width_spin"> <property name="visible">True</property> diff --git a/src/label-object.c b/src/label-object.c index 92a8ec2..8d48e53 100644 --- a/src/label-object.c +++ b/src/label-object.c @@ -783,6 +783,28 @@ gl_label_object_set_text_alignment (glLabelObject *object, /****************************************************************************/ +/* Set vertical text alignment for all text contained in object. */ +/****************************************************************************/ +void +gl_label_object_set_text_valignment (glLabelObject *object, + glValignment text_valignment, + gboolean checkpoint) +{ + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + if ( GL_LABEL_OBJECT_GET_CLASS(object)->set_text_valignment != NULL ) + { + /* We have an object specific method, use it */ + GL_LABEL_OBJECT_GET_CLASS(object)->set_text_valignment (object, text_valignment, checkpoint); + } + + gl_debug (DEBUG_LABEL, "END"); +} + + +/****************************************************************************/ /* Set text line spacing for all text contained in object. */ /****************************************************************************/ void @@ -947,6 +969,30 @@ gl_label_object_get_text_alignment (glLabelObject *object) /****************************************************************************/ +/* Get text alignment for all text contained in object. */ +/****************************************************************************/ +glValignment +gl_label_object_get_text_valignment (glLabelObject *object) +{ + glValignment ret = GL_VALIGN_TOP; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), GL_VALIGN_TOP); + + if ( GL_LABEL_OBJECT_GET_CLASS(object)->get_text_valignment != NULL ) + { + /* We have an object specific method, use it */ + ret = GL_LABEL_OBJECT_GET_CLASS(object)->get_text_valignment (object); + } + + gl_debug (DEBUG_LABEL, "END"); + + return ret; +} + + +/****************************************************************************/ /* Get text line spacing for all text contained in object. */ /****************************************************************************/ gdouble diff --git a/src/label-object.h b/src/label-object.h index 8e898a5..4c0e3e1 100644 --- a/src/label-object.h +++ b/src/label-object.h @@ -30,6 +30,13 @@ G_BEGIN_DECLS typedef enum { + GL_VALIGN_TOP, + GL_VALIGN_VCENTER, + GL_VALIGN_BOTTOM +} glValignment; + + +typedef enum { GL_LABEL_OBJECT_TEXT, GL_LABEL_OBJECT_BOX, GL_LABEL_OBJECT_LINE, @@ -109,6 +116,10 @@ struct _glLabelObjectClass { PangoAlignment text_alignment, gboolean checkpoint); + void (*set_text_valignment) (glLabelObject *object, + glValignment text_valignment, + gboolean checkpoint); + void (*set_text_line_spacing)(glLabelObject *object, gdouble text_line_spacing, gboolean checkpoint); @@ -143,6 +154,8 @@ struct _glLabelObjectClass { PangoAlignment (*get_text_alignment) (glLabelObject *object); + glValignment (*get_text_valignment) (glLabelObject *object); + gdouble (*get_text_line_spacing) (glLabelObject *object); glColorNode * (*get_text_color) (glLabelObject *object); @@ -273,6 +286,10 @@ void gl_label_object_set_text_alignment (glLabelObject *object, PangoAlignment text_alignment, gboolean checkpoint); +void gl_label_object_set_text_valignment (glLabelObject *object, + glValignment text_valignment, + gboolean checkpoint); + void gl_label_object_set_text_color (glLabelObject *object, glColorNode *text_color_node, gboolean checkpoint); @@ -351,6 +368,8 @@ gboolean gl_label_object_get_font_italic_flag (glLabelObject *object) PangoAlignment gl_label_object_get_text_alignment (glLabelObject *object); +glValignment gl_label_object_get_text_valignment (glLabelObject *object); + gdouble gl_label_object_get_text_line_spacing (glLabelObject *object); glColorNode *gl_label_object_get_text_color (glLabelObject *object); diff --git a/src/label-text.c b/src/label-text.c index d9146c4..b2a3231 100644 --- a/src/label-text.c +++ b/src/label-text.c @@ -60,6 +60,7 @@ struct _glLabelTextPrivate { PangoWeight font_weight; gboolean font_italic_flag; PangoAlignment align; + glValignment valign; glColorNode *color_node; gdouble line_spacing; gboolean auto_shrink; @@ -116,6 +117,10 @@ static void set_text_alignment (glLabelObject *object, PangoAlignment text_alignment, gboolean checkpoint); +static void set_text_valignment (glLabelObject *object, + glValignment text_valignment, + gboolean checkpoint); + static void set_text_line_spacing (glLabelObject *object, gdouble text_line_spacing, gboolean checkpoint); @@ -134,6 +139,8 @@ static gboolean get_font_italic_flag (glLabelObject *object); static PangoAlignment get_text_alignment (glLabelObject *object); +static glValignment get_text_valignment (glLabelObject *object); + static gdouble get_text_line_spacing (glLabelObject *object); static glColorNode* get_text_color (glLabelObject *object); @@ -202,6 +209,7 @@ gl_label_text_class_init (glLabelTextClass *class) label_object_class->set_font_weight = set_font_weight; label_object_class->set_font_italic_flag = set_font_italic_flag; label_object_class->set_text_alignment = set_text_alignment; + label_object_class->set_text_valignment = set_text_valignment; label_object_class->set_text_line_spacing = set_text_line_spacing; label_object_class->set_text_color = set_text_color; label_object_class->get_font_family = get_font_family; @@ -209,6 +217,7 @@ gl_label_text_class_init (glLabelTextClass *class) label_object_class->get_font_weight = get_font_weight; label_object_class->get_font_italic_flag = get_font_italic_flag; label_object_class->get_text_alignment = get_text_alignment; + label_object_class->get_text_valignment = get_text_valignment; label_object_class->get_text_line_spacing = get_text_line_spacing; label_object_class->get_text_color = get_text_color; label_object_class->draw_object = draw_object; @@ -290,6 +299,7 @@ gl_label_text_new (glLabel *label, ltext->priv->font_weight = gl_label_get_default_font_weight (label); ltext->priv->font_italic_flag = gl_label_get_default_font_italic_flag (label); ltext->priv->align = gl_label_get_default_text_alignment (label); + ltext->priv->valign = gl_label_get_default_text_valignment (label); ltext->priv->color_node = color_node; ltext->priv->line_spacing = gl_label_get_default_text_line_spacing (label); @@ -328,6 +338,7 @@ copy (glLabelObject *dst_object, new_ltext->priv->font_italic_flag = ltext->priv->font_italic_flag; set_text_color (dst_object, text_color_node, FALSE); new_ltext->priv->align = ltext->priv->align; + new_ltext->priv->valign = ltext->priv->valign; new_ltext->priv->line_spacing = ltext->priv->line_spacing; new_ltext->priv->auto_shrink = ltext->priv->auto_shrink; @@ -734,6 +745,39 @@ set_text_alignment (glLabelObject *object, /*****************************************************************************/ +/* Set vertical text alignment method. */ +/*****************************************************************************/ +static void +set_text_valignment (glLabelObject *object, + glValignment text_valignment, + gboolean checkpoint) +{ + glLabelText *ltext = (glLabelText *)object; + glLabel *label; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (ltext && GL_IS_LABEL_TEXT (ltext)); + + if (ltext->priv->valign != text_valignment) + { + if ( checkpoint ) + { + label = gl_label_object_get_parent (GL_LABEL_OBJECT (ltext)); + gl_label_checkpoint (label, _("Vertically align text")); + } + + ltext->priv->size_changed = TRUE; + + ltext->priv->valign = text_valignment; + gl_label_object_emit_changed (GL_LABEL_OBJECT(ltext)); + } + + gl_debug (DEBUG_LABEL, "END"); +} + + +/*****************************************************************************/ /* Set text line spacing method. */ /*****************************************************************************/ static void @@ -880,6 +924,22 @@ get_text_alignment (glLabelObject *object) /*****************************************************************************/ +/* Get vertical text alignment method. */ +/*****************************************************************************/ +static glValignment +get_text_valignment (glLabelObject *object) +{ + glLabelText *ltext = (glLabelText *)object; + + gl_debug (DEBUG_LABEL, ""); + + g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), GTK_JUSTIFY_LEFT); + + return ltext->priv->valign; +} + + +/*****************************************************************************/ /* Get text line spacing method. */ /*****************************************************************************/ static gdouble @@ -1025,6 +1085,7 @@ set_text_path (glLabelText *this, gboolean screen_flag, glMergeRecord *record) { + gint iw, ih, y; gdouble object_w, object_h; gdouble raw_w, raw_h; gchar *text; @@ -1092,9 +1153,22 @@ set_text_path (glLabelText *this, } pango_layout_set_wrap (layout, PANGO_WRAP_WORD); pango_layout_set_alignment (layout, this->priv->align); + pango_layout_get_pixel_size (layout, &iw, &ih); + switch (this->priv->valign) + { + case GL_VALIGN_VCENTER: + y = (object_h - ih) / 2; + break; + case GL_VALIGN_BOTTOM: + y = object_h - ih; + break; + default: + y = 0; + break; + } - cairo_move_to (cr, GL_LABEL_TEXT_MARGIN, 0); + cairo_move_to (cr, GL_LABEL_TEXT_MARGIN, y); pango_cairo_layout_path (cr, layout); g_object_unref (layout); diff --git a/src/label.c b/src/label.c index efa117f..1a7e1b6 100644 --- a/src/label.c +++ b/src/label.c @@ -75,6 +75,7 @@ struct _glLabelPrivate { gboolean default_font_italic_flag; guint default_text_color; PangoAlignment default_text_alignment; + glValignment default_text_valignment; gdouble default_text_line_spacing; /* Default object line properties */ @@ -2164,6 +2165,39 @@ gl_label_set_selection_text_alignment (glLabel *label, /*****************************************************************************/ +/* Set vertical text alignment for all text contained in selected objects. */ +/*****************************************************************************/ +void +gl_label_set_selection_text_valignment (glLabel *label, + glValignment text_valignment) +{ + GList *selection_list; + GList *p; + glLabelObject *object; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (label && GL_IS_LABEL (label)); + + begin_selection_op (label); + + selection_list = gl_label_get_selection_list (label); + + for (p = selection_list; p != NULL; p = p->next) + { + object = GL_LABEL_OBJECT (p->data); + gl_label_object_set_text_valignment (object, text_valignment, TRUE); + } + + g_list_free (selection_list); + + end_selection_op (label); + + gl_debug (DEBUG_LABEL, "END"); +} + + +/*****************************************************************************/ /* Set text line spacing for all text contained in selected objects. */ /*****************************************************************************/ void @@ -2810,6 +2844,22 @@ gl_label_set_default_text_alignment (glLabel *label, /****************************************************************************/ +/* Set default vertical text alignment. */ +/****************************************************************************/ +void +gl_label_set_default_text_valignment (glLabel *label, + glValignment text_valignment) +{ + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (label && GL_IS_LABEL (label)); + + label->priv->default_text_valignment = text_valignment; + gl_debug (DEBUG_LABEL, "END"); +} + + +/****************************************************************************/ /* Set default text line spacing. */ /****************************************************************************/ void @@ -2974,6 +3024,22 @@ gl_label_get_default_text_alignment (glLabel *label) /****************************************************************************/ +/* Get default vertical text alignment. */ +/****************************************************************************/ +glValignment +gl_label_get_default_text_valignment (glLabel *label) +{ + gl_debug (DEBUG_LABEL, "START"); + + g_return_val_if_fail (label && GL_IS_LABEL (label), GL_VALIGN_TOP); + + gl_debug (DEBUG_LABEL, "END"); + + return label->priv->default_text_valignment; +} + + +/****************************************************************************/ /* Get default text line spacing. */ /****************************************************************************/ gdouble diff --git a/src/label.h b/src/label.h index eccd608..0d59373 100644 --- a/src/label.h +++ b/src/label.h @@ -289,6 +289,9 @@ void gl_label_set_default_text_color (glLabel *label, void gl_label_set_default_text_alignment (glLabel *label, PangoAlignment text_alignment); +void gl_label_set_default_text_valignment (glLabel *label, + glValignment text_valignment); + void gl_label_set_default_line_width (glLabel *label, gdouble line_width); @@ -313,6 +316,8 @@ guint gl_label_get_default_text_color (glLabel *labe PangoAlignment gl_label_get_default_text_alignment (glLabel *label); +glValignment gl_label_get_default_text_valignment (glLabel *label); + gdouble gl_label_get_default_text_line_spacing(glLabel *label); gdouble gl_label_get_default_line_width (glLabel *label); diff --git a/src/object-editor-private.h b/src/object-editor-private.h index 053bcde..9e778b5 100644 --- a/src/object-editor-private.h +++ b/src/object-editor-private.h @@ -114,6 +114,9 @@ struct _glObjectEditorPrivate { GtkWidget *text_left_toggle; GtkWidget *text_center_toggle; GtkWidget *text_right_toggle; + GtkWidget *text_top_toggle; + GtkWidget *text_vcenter_toggle; + GtkWidget *text_bottom_toggle; GtkWidget *text_line_spacing_spin; GtkWidget *text_auto_shrink_check; @@ -326,6 +329,11 @@ void gl_object_editor_set_text_alignment (glObjectEditor *editor, PangoAlignment gl_object_editor_get_text_alignment (glObjectEditor *editor); +void gl_object_editor_set_text_valignment (glObjectEditor *editor, + glValignment text_valignment); + +glValignment gl_object_editor_get_text_valignment (glObjectEditor *editor); + void gl_object_editor_set_text_line_spacing (glObjectEditor *editor, gdouble text_line_spacing); diff --git a/src/object-editor-text-page.c b/src/object-editor-text-page.c index 7c82ec9..6acf71a 100644 --- a/src/object-editor-text-page.c +++ b/src/object-editor-text-page.c @@ -60,6 +60,8 @@ static void align_toggle_cb (GtkToggleButton *toggle, glObjectEditor *editor); +static void valign_toggle_cb (GtkToggleButton *toggle, + glObjectEditor *editor); static void text_radio_toggled_cb (glObjectEditor *editor); @@ -85,6 +87,9 @@ gl_object_editor_prepare_text_page (glObjectEditor *editor) "text_left_toggle", &editor->priv->text_left_toggle, "text_center_toggle", &editor->priv->text_center_toggle, "text_right_toggle", &editor->priv->text_right_toggle, + "text_top_toggle", &editor->priv->text_top_toggle, + "text_vcenter_toggle", &editor->priv->text_vcenter_toggle, + "text_bottom_toggle", &editor->priv->text_bottom_toggle, "text_line_spacing_spin", &editor->priv->text_line_spacing_spin, "text_auto_shrink_check", &editor->priv->text_auto_shrink_check, NULL); @@ -162,6 +167,19 @@ gl_object_editor_prepare_text_page (glObjectEditor *editor) G_CALLBACK (align_toggle_cb), G_OBJECT (editor)); + g_signal_connect (G_OBJECT (editor->priv->text_top_toggle), + "toggled", + G_CALLBACK (valign_toggle_cb), + G_OBJECT (editor)); + g_signal_connect (G_OBJECT (editor->priv->text_vcenter_toggle), + "toggled", + G_CALLBACK (valign_toggle_cb), + G_OBJECT (editor)); + g_signal_connect (G_OBJECT (editor->priv->text_bottom_toggle), + "toggled", + G_CALLBACK (valign_toggle_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->text_line_spacing_spin), "value-changed", G_CALLBACK (gl_object_editor_changed_cb), @@ -216,6 +234,46 @@ align_toggle_cb (GtkToggleButton *toggle, } +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Vertical alignment togglebutton callback. */ +/*--------------------------------------------------------------------------*/ +static void +valign_toggle_cb (GtkToggleButton *toggle, + glObjectEditor *editor) +{ + if (gtk_toggle_button_get_active (toggle)) { + + if (GTK_WIDGET (toggle) == GTK_WIDGET (editor->priv->text_top_toggle)) { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (editor->priv->text_vcenter_toggle), + FALSE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (editor->priv->text_bottom_toggle), + FALSE); + } else if (GTK_WIDGET (toggle) == + GTK_WIDGET (editor->priv->text_vcenter_toggle)) { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (editor->priv->text_top_toggle), + FALSE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (editor->priv->text_bottom_toggle), + FALSE); + } else if (GTK_WIDGET (toggle) == + GTK_WIDGET (editor->priv->text_bottom_toggle)) { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (editor->priv->text_top_toggle), + FALSE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (editor->priv->text_vcenter_toggle), + FALSE); + } + + gl_object_editor_changed_cb (editor); + } + +} + + /*****************************************************************************/ /* Set font family. */ /*****************************************************************************/ @@ -478,6 +536,69 @@ gl_object_editor_get_text_alignment (glObjectEditor *editor) /*****************************************************************************/ +/* Set vertical text alignment. */ +/*****************************************************************************/ +void +gl_object_editor_set_text_valignment (glObjectEditor *editor, + glValignment valign) +{ + gl_debug (DEBUG_EDITOR, "START"); + + + g_signal_handlers_block_by_func (G_OBJECT (editor->priv->text_top_toggle), valign_toggle_cb, editor); + g_signal_handlers_block_by_func (G_OBJECT (editor->priv->text_vcenter_toggle), valign_toggle_cb, editor); + g_signal_handlers_block_by_func (G_OBJECT (editor->priv->text_bottom_toggle), valign_toggle_cb, editor); + + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->text_top_toggle), + (valign == GL_VALIGN_TOP)); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->text_vcenter_toggle), + (valign == GL_VALIGN_VCENTER)); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->text_bottom_toggle), + (valign == GL_VALIGN_BOTTOM)); + + + g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->text_top_toggle), valign_toggle_cb, editor); + g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->text_vcenter_toggle), valign_toggle_cb, editor); + g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->text_bottom_toggle), valign_toggle_cb, editor); + + + gl_debug (DEBUG_EDITOR, "END"); +} + + +/*****************************************************************************/ +/* Query vertical text alignment. */ +/*****************************************************************************/ +glValignment +gl_object_editor_get_text_valignment (glObjectEditor *editor) +{ + glValignment valign; + + gl_debug (DEBUG_EDITOR, "START"); + + if (gtk_toggle_button_get_active + (GTK_TOGGLE_BUTTON (editor->priv->text_top_toggle))) { + valign = GL_VALIGN_TOP; + } else + if (gtk_toggle_button_get_active + (GTK_TOGGLE_BUTTON (editor->priv->text_bottom_toggle))) { + valign = GL_VALIGN_BOTTOM; + } else + if (gtk_toggle_button_get_active + (GTK_TOGGLE_BUTTON (editor->priv->text_vcenter_toggle))) { + valign = GL_VALIGN_VCENTER; + } else { + valign = GL_VALIGN_TOP; /* Should not happen. */ + } + + gl_debug (DEBUG_EDITOR, "END"); + + return valign; +} + + +/*****************************************************************************/ /* Set text color. */ /*****************************************************************************/ void diff --git a/src/object-editor.c b/src/object-editor.c index 68cfa49..abbce23 100644 --- a/src/object-editor.c +++ b/src/object-editor.c @@ -749,6 +749,7 @@ object_changed_cb (glLabelObject *object, gboolean font_italic_flag; glColorNode *text_color_node; PangoAlignment align; + glValignment valign; gdouble text_line_spacing; gboolean auto_shrink; gdouble image_w, image_h; @@ -825,6 +826,7 @@ object_changed_cb (glLabelObject *object, font_italic_flag = gl_label_object_get_font_italic_flag (object); text_color_node = gl_label_object_get_text_color (object); align = gl_label_object_get_text_alignment (object); + valign = gl_label_object_get_text_valignment (object); text_line_spacing = gl_label_object_get_text_line_spacing (object); auto_shrink = gl_label_text_get_auto_shrink (GL_LABEL_TEXT (object)); @@ -835,6 +837,7 @@ object_changed_cb (glLabelObject *object, gl_object_editor_set_font_italic_flag (editor, font_italic_flag); gl_object_editor_set_text_color (editor, (merge != NULL), text_color_node); gl_object_editor_set_text_alignment (editor, align); + gl_object_editor_set_text_valignment (editor, valign); gl_object_editor_set_text_line_spacing (editor, text_line_spacing); gl_object_editor_set_text_auto_shrink (editor, auto_shrink); @@ -913,6 +916,7 @@ gl_object_editor_changed_cb (glObjectEditor *editor) gboolean font_italic_flag; glColorNode *text_color_node; PangoAlignment align; + glValignment valign; gdouble text_line_spacing; gboolean auto_shrink; glTextNode *filename; @@ -995,6 +999,7 @@ gl_object_editor_changed_cb (glObjectEditor *editor) font_italic_flag = gl_object_editor_get_font_italic_flag (editor); text_color_node = gl_object_editor_get_text_color (editor); align = gl_object_editor_get_text_alignment (editor); + valign = gl_object_editor_get_text_valignment (editor); text_line_spacing = gl_object_editor_get_text_line_spacing (editor); auto_shrink = gl_object_editor_get_text_auto_shrink (editor); @@ -1004,6 +1009,7 @@ gl_object_editor_changed_cb (glObjectEditor *editor) gl_label_object_set_font_italic_flag (object, font_italic_flag, TRUE); gl_label_object_set_text_color (object, text_color_node, TRUE); gl_label_object_set_text_alignment (object, align, TRUE); + gl_label_object_set_text_valignment (object, valign, TRUE); gl_label_object_set_text_line_spacing (object, text_line_spacing, TRUE); gl_label_text_set_auto_shrink (GL_LABEL_TEXT (object), auto_shrink, TRUE); diff --git a/src/str-util.c b/src/str-util.c index f8c6d70..deb939f 100644 --- a/src/str-util.c +++ b/src/str-util.c @@ -25,6 +25,8 @@ #include <string.h> #include <math.h> +#include "label-object.h" + /****************************************************************************/ /* Utilities to deal with PangoAlignment types. */ @@ -63,6 +65,42 @@ gl_str_util_string_to_align (const gchar *string) /****************************************************************************/ +/* Utilities to deal with vertical alignment types. */ +/****************************************************************************/ +const gchar * +gl_str_util_valign_to_string (glValignment valign) +{ + switch (valign) { + case GL_VALIGN_TOP: + return "Top"; + case GL_VALIGN_VCENTER: + return "Center"; + case GL_VALIGN_BOTTOM: + return "Bottom"; + default: + return "?"; + } +} + + +glValignment +gl_str_util_string_to_valign (const gchar *string) +{ + + if (g_ascii_strcasecmp (string, "Top") == 0) { + return GL_VALIGN_TOP; + } else if (g_ascii_strcasecmp (string, "Center") == 0) { + return GL_VALIGN_VCENTER; + } else if (g_ascii_strcasecmp (string, "Bottom") == 0) { + return GL_VALIGN_BOTTOM; + } else { + return GL_VALIGN_TOP; + } + +} + + +/****************************************************************************/ /* Utilities to deal with PangoWeight types */ /****************************************************************************/ const gchar * diff --git a/src/ui-property-bar.c b/src/ui-property-bar.c index 4e26f5c..e4eba22 100644 --- a/src/ui-property-bar.c +++ b/src/ui-property-bar.c @@ -59,11 +59,16 @@ struct _glUIPropertyBarPrivate { GtkWidget *font_bold_toggle; GtkWidget *font_italic_toggle; - /* Text alignemnt radios */ + /* Text alignment radios */ GtkWidget *text_align_left_radio; GtkWidget *text_align_center_radio; GtkWidget *text_align_right_radio; + /* Text vertical alignment radios */ + GtkWidget *text_valign_top_radio; + GtkWidget *text_valign_vcenter_radio; + GtkWidget *text_valign_bottom_radio; + /* Color combos */ GtkWidget *text_color_eventbox; GtkWidget *text_color_button; @@ -129,6 +134,9 @@ static void font_italic_toggled_cb (GtkToggleToolButton *toggle, static void text_align_toggled_cb (GtkToggleToolButton *toggle, glUIPropertyBar *this); +static void text_valign_toggled_cb (GtkToggleToolButton *toggle, + glUIPropertyBar *this); + static void set_doc_items_sensitive (glUIPropertyBar *this, gboolean state); @@ -251,18 +259,21 @@ gl_ui_property_bar_construct (glUIPropertyBar *this) } gl_builder_util_get_widgets (builder, - "property_toolbar", &this->priv->tool_bar, - "font_family_eventbox", &this->priv->font_family_eventbox, - "font_size_spin", &this->priv->font_size_spin, - "font_bold_toggle", &this->priv->font_bold_toggle, - "font_italic_toggle", &this->priv->font_italic_toggle, - "text_align_left_radio", &this->priv->text_align_left_radio, - "text_align_center_radio", &this->priv->text_align_center_radio, - "text_align_right_radio", &this->priv->text_align_right_radio, - "text_color_eventbox", &this->priv->text_color_eventbox, - "fill_color_eventbox", &this->priv->fill_color_eventbox, - "line_color_eventbox", &this->priv->line_color_eventbox, - "line_width_spin", &this->priv->line_width_spin, + "property_toolbar", &this->priv->tool_bar, + "font_family_eventbox", &this->priv->font_family_eventbox, + "font_size_spin", &this->priv->font_size_spin, + "font_bold_toggle", &this->priv->font_bold_toggle, + "font_italic_toggle", &this->priv->font_italic_toggle, + "text_align_left_radio", &this->priv->text_align_left_radio, + "text_align_center_radio", &this->priv->text_align_center_radio, + "text_align_right_radio", &this->priv->text_align_right_radio, + "text_valign_top_radio", &this->priv->text_valign_top_radio, + "text_valign_vcenter_radio", &this->priv->text_valign_vcenter_radio, + "text_valign_bottom_radio", &this->priv->text_valign_bottom_radio, + "text_color_eventbox", &this->priv->text_color_eventbox, + "fill_color_eventbox", &this->priv->fill_color_eventbox, + "line_color_eventbox", &this->priv->line_color_eventbox, + "line_width_spin", &this->priv->line_width_spin, NULL); gtk_container_add (GTK_CONTAINER (this), this->priv->tool_bar); @@ -344,6 +355,17 @@ gl_ui_property_bar_construct (glUIPropertyBar *this) g_signal_connect (G_OBJECT (this->priv->text_align_right_radio), "toggled", G_CALLBACK (text_align_toggled_cb), this); + /* Text vertical alignment radio group */ + gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (this->priv->text_valign_top_radio), TRUE); + g_signal_connect (G_OBJECT (this->priv->text_valign_top_radio), + "toggled", G_CALLBACK (text_valign_toggled_cb), this); + gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (this->priv->text_valign_vcenter_radio), FALSE); + g_signal_connect (G_OBJECT (this->priv->text_valign_vcenter_radio), + "toggled", G_CALLBACK (text_valign_toggled_cb), this); + gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (this->priv->text_valign_bottom_radio), FALSE); + g_signal_connect (G_OBJECT (this->priv->text_valign_bottom_radio), + "toggled", G_CALLBACK (text_valign_toggled_cb), this); + /* Text color widget */ gl_color_combo_button_set_color (GL_COLOR_COMBO_BUTTON (this->priv->text_color_button), gl_prefs_model_get_default_text_color (gl_prefs)); @@ -404,6 +426,13 @@ reset_to_default_properties (glLabel *label, gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (this->priv->text_align_right_radio), (gl_label_get_default_text_alignment (label) == PANGO_ALIGN_RIGHT)); + gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (this->priv->text_valign_top_radio), + (gl_label_get_default_text_valignment (label) == GL_VALIGN_TOP)); + gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (this->priv->text_valign_vcenter_radio), + (gl_label_get_default_text_valignment (label) == GL_VALIGN_VCENTER)); + gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (this->priv->text_valign_bottom_radio), + (gl_label_get_default_text_valignment (label) == GL_VALIGN_BOTTOM)); + gl_color_combo_button_set_color (GL_COLOR_COMBO_BUTTON(this->priv->text_color_button), gl_label_get_default_text_color (label)); @@ -455,7 +484,7 @@ update_text_properties (glLabel *label, gboolean can_text, is_first_object; gboolean is_same_font_family, is_same_font_size; gboolean is_same_text_color, is_same_is_italic; - gboolean is_same_is_bold, is_same_align; + gboolean is_same_is_bold, is_same_align, is_same_valign; GList *selection_list; GList *p; glLabelObject *object; @@ -466,6 +495,7 @@ update_text_properties (glLabel *label, gboolean selection_is_italic, is_italic; gboolean selection_is_bold, is_bold; PangoAlignment selection_align, align; + glValignment selection_valign, valign; can_text = gl_label_can_selection_text (label); set_text_items_sensitive (this, can_text); @@ -476,6 +506,7 @@ update_text_properties (glLabel *label, is_same_is_italic = is_same_is_bold = is_same_align = + is_same_valign = is_same_text_color = is_same_font_size = is_same_font_family = TRUE; @@ -531,6 +562,7 @@ update_text_properties (glLabel *label, is_italic = gl_label_object_get_font_italic_flag (object); is_bold = gl_label_object_get_font_weight (object) == PANGO_WEIGHT_BOLD; align = gl_label_object_get_text_alignment (object); + valign = gl_label_object_get_text_valignment (object); if (is_first_object) { @@ -539,6 +571,7 @@ update_text_properties (glLabel *label, selection_is_italic = is_italic; selection_is_bold = is_bold; selection_align = align; + selection_valign = valign; } else { @@ -552,6 +585,8 @@ update_text_properties (glLabel *label, is_same_is_bold = FALSE; if (align != selection_align) is_same_align = FALSE; + if (valign != selection_valign) + is_same_valign = FALSE; } is_first_object = FALSE; } @@ -611,6 +646,18 @@ update_text_properties (glLabel *label, gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (this->priv->text_align_right_radio), (selection_align == PANGO_ALIGN_RIGHT) && is_same_align); + + if (is_same_valign) + gl_debug (DEBUG_PROPERTY_BAR, "same valign"); + gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (this->priv->text_valign_top_radio), + (selection_valign == GL_VALIGN_TOP) && + is_same_valign); + gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (this->priv->text_valign_vcenter_radio), + (selection_valign == GL_VALIGN_VCENTER) && + is_same_valign); + gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (this->priv->text_valign_bottom_radio), + (selection_valign == GL_VALIGN_BOTTOM) && + is_same_valign); } @@ -1171,23 +1218,68 @@ text_align_toggled_cb (GtkToggleToolButton *toggle, /*---------------------------------------------------------------------------*/ +/* PRIVATE. Text vertical align toggled callback. */ +/*---------------------------------------------------------------------------*/ +static void +text_valign_toggled_cb (GtkToggleToolButton *toggle, + glUIPropertyBar *this) +{ + if (this->priv->stop_signals) return; + this->priv->stop_signals = TRUE; + + gl_debug (DEBUG_PROPERTY_BAR, "START"); + + if (gtk_toggle_tool_button_get_active (GTK_TOGGLE_TOOL_BUTTON (this->priv->text_valign_top_radio))) + { + gl_label_set_selection_text_valignment (this->priv->label, + GL_VALIGN_TOP); + gl_label_set_default_text_valignment (this->priv->label, + GL_VALIGN_TOP); + } + + if (gtk_toggle_tool_button_get_active (GTK_TOGGLE_TOOL_BUTTON (this->priv->text_valign_vcenter_radio))) + { + gl_label_set_selection_text_valignment (this->priv->label, + GL_VALIGN_VCENTER); + gl_label_set_default_text_valignment (this->priv->label, + GL_VALIGN_VCENTER); + } + + if (gtk_toggle_tool_button_get_active (GTK_TOGGLE_TOOL_BUTTON (this->priv->text_valign_bottom_radio))) + { + gl_label_set_selection_text_valignment (this->priv->label, + GL_VALIGN_BOTTOM); + gl_label_set_default_text_valignment (this->priv->label, + GL_VALIGN_BOTTOM); + } + + gl_debug (DEBUG_PROPERTY_BAR, "END"); + + this->priv->stop_signals = FALSE; +} + + +/*---------------------------------------------------------------------------*/ /* PRIVATE. Set sensitivity of doc controls. */ /*---------------------------------------------------------------------------*/ static void set_doc_items_sensitive (glUIPropertyBar *this, gboolean state) { - gtk_widget_set_sensitive (this->priv->font_family_combo, state); - gtk_widget_set_sensitive (this->priv->font_size_spin, state); - gtk_widget_set_sensitive (this->priv->font_bold_toggle, state); - gtk_widget_set_sensitive (this->priv->font_italic_toggle, state); - gtk_widget_set_sensitive (this->priv->text_align_left_radio, state); - gtk_widget_set_sensitive (this->priv->text_align_center_radio, state); - gtk_widget_set_sensitive (this->priv->text_align_right_radio, state); - gtk_widget_set_sensitive (this->priv->text_color_button, state); - gtk_widget_set_sensitive (this->priv->fill_color_button, state); - gtk_widget_set_sensitive (this->priv->line_color_button, state); - gtk_widget_set_sensitive (this->priv->line_width_spin, state); + gtk_widget_set_sensitive (this->priv->font_family_combo, state); + gtk_widget_set_sensitive (this->priv->font_size_spin, state); + gtk_widget_set_sensitive (this->priv->font_bold_toggle, state); + gtk_widget_set_sensitive (this->priv->font_italic_toggle, state); + gtk_widget_set_sensitive (this->priv->text_align_left_radio, state); + gtk_widget_set_sensitive (this->priv->text_align_center_radio, state); + gtk_widget_set_sensitive (this->priv->text_align_right_radio, state); + gtk_widget_set_sensitive (this->priv->text_valign_top_radio, state); + gtk_widget_set_sensitive (this->priv->text_valign_vcenter_radio, state); + gtk_widget_set_sensitive (this->priv->text_valign_bottom_radio, state); + gtk_widget_set_sensitive (this->priv->text_color_button, state); + gtk_widget_set_sensitive (this->priv->fill_color_button, state); + gtk_widget_set_sensitive (this->priv->line_color_button, state); + gtk_widget_set_sensitive (this->priv->line_width_spin, state); } @@ -1198,14 +1290,17 @@ static void set_text_items_sensitive (glUIPropertyBar *this, gboolean state) { - gtk_widget_set_sensitive (this->priv->font_family_combo, state); - gtk_widget_set_sensitive (this->priv->font_size_spin, state); - gtk_widget_set_sensitive (this->priv->font_bold_toggle, state); - gtk_widget_set_sensitive (this->priv->font_italic_toggle, state); - gtk_widget_set_sensitive (this->priv->text_align_left_radio, state); - gtk_widget_set_sensitive (this->priv->text_align_center_radio, state); - gtk_widget_set_sensitive (this->priv->text_align_right_radio, state); - gtk_widget_set_sensitive (this->priv->text_color_button, state); + gtk_widget_set_sensitive (this->priv->font_family_combo, state); + gtk_widget_set_sensitive (this->priv->font_size_spin, state); + gtk_widget_set_sensitive (this->priv->font_bold_toggle, state); + gtk_widget_set_sensitive (this->priv->font_italic_toggle, state); + gtk_widget_set_sensitive (this->priv->text_align_left_radio, state); + gtk_widget_set_sensitive (this->priv->text_align_center_radio, state); + gtk_widget_set_sensitive (this->priv->text_align_right_radio, state); + gtk_widget_set_sensitive (this->priv->text_valign_top_radio, state); + gtk_widget_set_sensitive (this->priv->text_valign_vcenter_radio, state); + gtk_widget_set_sensitive (this->priv->text_valign_bottom_radio, state); + gtk_widget_set_sensitive (this->priv->text_color_button, state); } diff --git a/src/xml-label.c b/src/xml-label.c index 79b4646..f7743fd 100644 --- a/src/xml-label.c +++ b/src/xml-label.c @@ -436,6 +436,7 @@ xml_parse_object_text (xmlNodePtr node, gdouble w, h; gchar *string; PangoAlignment align; + glValignment valign; gboolean auto_shrink; xmlNodePtr child; @@ -459,6 +460,12 @@ xml_parse_object_text (xmlNodePtr node, g_free (string); gl_label_object_set_text_alignment (GL_LABEL_OBJECT(object), align, FALSE); + /* valign attr */ + string = lgl_xml_get_prop_string (node, "valign", NULL); + valign = gl_str_util_string_to_valign (string); + g_free (string); + gl_label_object_set_text_valignment (GL_LABEL_OBJECT(object), valign, FALSE); + /* auto_shrink attr */ auto_shrink = lgl_xml_get_prop_boolean (node, "auto_shrink", FALSE); gl_label_text_set_auto_shrink (GL_LABEL_TEXT(object), auto_shrink, FALSE); @@ -1321,6 +1328,7 @@ xml_create_object_text (xmlNodePtr parent, gdouble x, y; gdouble w, h; PangoAlignment align; + glValignment valign; gboolean auto_shrink; gl_debug (DEBUG_XML, "START"); @@ -1341,6 +1349,10 @@ xml_create_object_text (xmlNodePtr parent, align = gl_label_object_get_text_alignment (object); lgl_xml_set_prop_string (node, "justify", gl_str_util_align_to_string (align)); + /* valign attr */ + valign = gl_label_object_get_text_valignment (object); + lgl_xml_set_prop_string (node, "valign", gl_str_util_valign_to_string (valign)); + /* auto_shrink attr */ auto_shrink = gl_label_text_get_auto_shrink (GL_LABEL_TEXT (object)); lgl_xml_set_prop_boolean (node, "auto_shrink", auto_shrink); diff --git a/templates/glabels-3.0.dtd b/templates/glabels-3.0.dtd index 5e74553..7e8dcc1 100644 --- a/templates/glabels-3.0.dtd +++ b/templates/glabels-3.0.dtd @@ -41,6 +41,7 @@ <!-- Text related enumerations/types --> <!ENTITY % JUSTIFY_TYPE "(Left | Right | Center)"> +<!ENTITY % VALIGN_TYPE "(Top | Bottom | Center)"> <!ENTITY % FONT_WEIGHT_TYPE "(Regular | Bold)"> <!-- Barcode related enumerations/types --> @@ -344,6 +345,7 @@ %position_attrs; %size_attrs; justify %JUSTIFY_TYPE; #REQUIRED + valign %VALIGN_TYPE; #REQUIRED auto_shrink %BOOLEAN_TYPE; #IMPLIED %affine_attrs; %shadow_attrs; |