[balsa] Fix toolbar button text alignment issue



commit 5009bc931a0ee0bda61de136bbf249e293fc9de0
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Sun Dec 5 16:18:27 2010 -0500

    Fix toolbar button text alignment issue
    
    	* src/toolbar-factory.c (tm_populate): do not make 2-line
    	toolbar button text if we are using the desktop default and it
    	is GTK_TOOLBAR_BOTH_HORIZ; fixes a strange vertical alignment
    	issue when using the default and it is GTK_TOOLBAR_BOTH_HORIZ.

 ChangeLog             |    7 +++++++
 src/toolbar-factory.c |   12 ++++++++++--
 2 files changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b749121..059cc13 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-12-05  Peter Bloomfield
+
+	* src/toolbar-factory.c (tm_populate): do not make 2-line
+	toolbar button text if we are using the desktop default and it
+	is GTK_TOOLBAR_BOTH_HORIZ; fixes a strange vertical alignment
+	issue when using the default and it is GTK_TOOLBAR_BOTH_HORIZ.
+
 2010-11-19  Pawel Salek
 
 	* Configure.in: compile against libnotify-0.4.x as well.
diff --git a/src/toolbar-factory.c b/src/toolbar-factory.c
index 2e92163..d4a700a 100644
--- a/src/toolbar-factory.c
+++ b/src/toolbar-factory.c
@@ -463,14 +463,22 @@ tm_set_tool_item_label(GtkToolItem * tool_item, const gchar * stock_id,
     return button;
 }
 
+static GtkToolbarStyle tm_default_style(void);
+
 static void
 tm_populate(BalsaToolbarModel * model, GtkUIManager * ui_manager,
             GArray * merge_ids)
 {
-    gboolean make_two_line = model->style != GTK_TOOLBAR_BOTH_HORIZ
-        && tm_has_second_line(model);
+    gboolean style_is_both_horiz;
+    gboolean make_two_line;
     GSList *list;
 
+    style_is_both_horiz = (model->style == GTK_TOOLBAR_BOTH_HORIZ
+                           || (model->style == (GtkToolbarStyle) -1
+                               && tm_default_style() ==
+                               GTK_TOOLBAR_BOTH_HORIZ));
+    make_two_line = !style_is_both_horiz && tm_has_second_line(model);
+
     for (list = balsa_toolbar_model_get_current(model); list;
          list = list->next) {
         const gchar *stock_id = list->data;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]