diff src/ui_misc.c @ 41:6281cc38e5ca

Wed Apr 27 15:17:57 2005 John Ellis <johne@verizon.net> * bar_info.c, bar_sort.c: Update for new pref_toolbar_button args. * fullscreen.c, layout.c: Remove use of GDK_HINT_USER_SIZE as we never actually set these dimensions. Increase default size of main window. * layout_util.c: Use GTkToolbar for the main window toolbar. * pixbuf_util.[ch]: Add inline pixbufs for thumb and float icons. * rcfile.c: Add note to config file that it is autogenerated. * typedefs.h: Remove no longer used tooltip in LayoutWindow. * ui_misc.[ch]: pref_toolbar additions. * icons/icon_float.png, icons/icon_thumb.png: Icons in png format. * icons/icon_float.xpm, icons/icon_thumb.xpm: Remove xpm versions. * icons/Makefile.am: Add above icons to inline pixbuf list. ##### Note: GQview CVS on sourceforge is not always up to date, please use ##### ##### an offical release when making enhancements and translation updates. #####
author gqview
date Wed, 27 Apr 2005 19:29:15 +0000
parents d907d608745f
children 04ff0df3ad2f
line wrap: on
line diff
--- a/src/ui_misc.c	Sat Apr 16 16:26:49 2005 +0000
+++ b/src/ui_misc.c	Wed Apr 27 19:29:15 2005 +0000
@@ -749,13 +749,37 @@
 	return tbar;
 }
 
-GtkWidget *pref_toolbar_button(GtkWidget *toolbar, const gchar *stock_id, const gchar *label,
+GtkWidget *pref_toolbar_button(GtkWidget *toolbar,
+			       const gchar *stock_id, const gchar *label, gint toggle,
 			       const gchar *description,
 			       GCallback func, gpointer data)
 {
 	GtkWidget *item;
 
-	item = GTK_WIDGET(gtk_tool_button_new_from_stock(stock_id));
+	if (toggle)
+		{
+		if (stock_id)
+			{
+			item = GTK_WIDGET(gtk_toggle_tool_button_new_from_stock(stock_id));
+			}
+		else
+			{
+			item = GTK_WIDGET(gtk_toggle_tool_button_new());
+			}
+		}
+	else
+		{
+		if (stock_id)
+			{
+			item = GTK_WIDGET(gtk_tool_button_new_from_stock(stock_id));
+			}
+		else
+			{
+			item = GTK_WIDGET(gtk_tool_button_new(NULL, NULL));
+			}
+		}
+	gtk_tool_button_set_use_underline(GTK_TOOL_BUTTON(item), TRUE);
+
 	if (label) gtk_tool_button_set_label(GTK_TOOL_BUTTON(item), label);
 
 	if (func) g_signal_connect(item, "clicked", func, data);
@@ -773,6 +797,18 @@
 	return item;
 }
 
+void pref_toolbar_button_set_icon(GtkWidget *button, GtkWidget *widget, const gchar *stock_id)
+{
+	if (widget)
+		{
+		gtk_tool_button_set_icon_widget(GTK_TOOL_BUTTON(button), widget);
+		}
+	else if (stock_id)
+		{
+		gtk_tool_button_set_stock_id(GTK_TOOL_BUTTON(button), stock_id);
+		}
+}
+
 GtkWidget *pref_toolbar_spacer(GtkWidget *toolbar)
 {
 	GtkWidget *item;