patch for making Bonobo respect GNOME labels-in-toolbar-buttons preference



Here's a simple patch for making Bonobo respect GNOME's preference for
showing labels in toolbar buttons. While I was in there, I also made it
respect the three XML-specified looks "both", "icon", and "text"
(formerly it checked for "both" and fell back to icons-only in all other
cases).

Michael, OK to check this in?

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/bonobo/ChangeLog,v
retrieving revision 1.787
diff -u -p -u -r1.787 ChangeLog
--- ChangeLog	2000/12/04 21:24:28	1.787
+++ ChangeLog	2000/12/04 22:49:40
@@ -1,3 +1,10 @@
+2000-12-04  John Sullivan  <sullivan eazel com>
+
+	* bonobo/bonobo-win.c: (parse_look):
+	Made toolbar respect xml-specified looks "both", "icon", and "text", 
+	as the FAQ said it did. Also, if no look (or some unknown look) is 
+	specified, fall	back to using GNOME preference.
+
 2000-12-04  Michael Meeks  <michael helixcode com>
 
 	* bonobo/bonobo-control.c (process_events): only work through the
event queue
Index: bonobo/bonobo-win.c
===================================================================
RCS file: /cvs/gnome/bonobo/bonobo/bonobo-win.c,v
retrieving revision 1.88
diff -u -p -u -r1.88 bonobo-win.c
--- bonobo/bonobo-win.c	2000/12/04 07:21:33	1.88
+++ bonobo/bonobo-win.c	2000/12/04 22:49:47
@@ -2451,10 +2451,20 @@ toolbar_sync_state (BonoboWindowPrivate 
 static BonoboUIToolbarStyle
 parse_look (const char *look)
 {
-	if (!look || !strcmp (look, "both"))
-		return BONOBO_UI_TOOLBAR_STYLE_ICONS_AND_TEXT;
-	else
-		return BONOBO_UI_TOOLBAR_STYLE_ICONS_ONLY;
+	if (look) {
+		if (!strcmp (look, "both"))
+			return BONOBO_UI_TOOLBAR_STYLE_ICONS_AND_TEXT;
+
+		if (!strcmp (look, "icon"))
+			return BONOBO_UI_TOOLBAR_STYLE_ICONS_ONLY;
+
+		if (!strcmp (look, "text"))
+			return BONOBO_UI_TOOLBAR_STYLE_PRIORITY_TEXT;	
+	}
+
+	return gnome_preferences_get_toolbar_labels ()
+		? BONOBO_UI_TOOLBAR_STYLE_ICONS_AND_TEXT
+		: BONOBO_UI_TOOLBAR_STYLE_ICONS_ONLY;
 }
 
 static void




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