changeset 374:7493af3a4ce2

[gaim-migrate @ 384] Patch by Travis Emslander to resize applet committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sat, 10 Jun 2000 02:19:05 +0000
parents 1d29321843b0
children 1eae69f076d2
files src/gnome_applet_mgr.c
diffstat 1 files changed, 36 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/gnome_applet_mgr.c	Sat Jun 10 00:48:43 2000 +0000
+++ b/src/gnome_applet_mgr.c	Sat Jun 10 02:19:05 2000 +0000
@@ -68,6 +68,8 @@
 
 static GtkAllocation get_applet_pos(gboolean);
 
+gint sizehint=48;
+
 /***************************************************************
 **
 ** function load_applet_icon
@@ -119,6 +121,27 @@
 	free(path);
 	return result;
 }
+/***************************************************************
+**
+** function applet_change_pixel_size
+** visibility - private
+**
+** input:
+**	w - applet that called the signal
+**	size - size of panel
+**	data - extra data (in this case NULL)
+**
+** description - changes the size of the applet when the panel size
+**	changes
+**
+***************************************************************/
+#ifdef HAVE_PANEL_PIXEL_SIZE
+void applet_change_pixel_size(GtkWidget *w, int size, gpointer data)
+{
+	sizehint = size;
+	update_pixmaps();
+}
+#endif
 
 /***************************************************************
 **
@@ -191,13 +214,14 @@
 		sprintf(GAIM_GNOME_CONNECT_ICON, "%s",  GAIM_GNOME_PENGUIN_CONNECT);
 		sprintf(GAIM_GNOME_ONLINE_ICON, "%s",  GAIM_GNOME_PENGUIN_ONLINE);
 	}
-	load_applet_icon( GAIM_GNOME_OFFLINE_ICON, 32, 34,
+	load_applet_icon( GAIM_GNOME_OFFLINE_ICON, (sizehint-16), (sizehint-12),
 			&icon_offline_pm, &icon_offline_bm );
-	load_applet_icon( GAIM_GNOME_CONNECT_ICON, 32, 34,
+	load_applet_icon( GAIM_GNOME_CONNECT_ICON, (sizehint-16), (sizehint-12),
 			&icon_connect_pm, &icon_connect_bm );
-	load_applet_icon( GAIM_GNOME_ONLINE_ICON, 32, 34,
+	load_applet_icon( GAIM_GNOME_ONLINE_ICON, (sizehint-16), (sizehint-12),
 			&icon_online_pm, &icon_online_bm );
 	update_applet((gpointer *)applet);
+	gtk_widget_set_usize(appletframe, sizehint, sizehint);
 }
 
 
@@ -530,9 +554,11 @@
 				GDK_BUTTON_PRESS_MASK);
 
         appletframe = gtk_frame_new(NULL);
-        
+#ifdef HAVE_PANEL_PIXEL_SIZE
+	gtk_widget_set_usize(appletframe, 5, 5);
+#else
         gtk_widget_set_usize(appletframe, 48, 48);
-        
+#endif   
 	
 	/*load offline icon*/
 	load_applet_icon( GAIM_GNOME_OFFLINE_ICON, 32, 32,
@@ -590,6 +616,11 @@
 					      
 	gtk_signal_connect( GTK_OBJECT(applet), "button_press_event", GTK_SIGNAL_FUNC( AppletClicked), NULL);
 
+#ifdef HAVE_PANEL_PIXEL_SIZE
+	gtk_signal_connect(GTK_OBJECT(applet), "change_pixel_size",
+			GTK_SIGNAL_FUNC(applet_change_pixel_size), NULL);
+#endif
+	
         gtk_widget_show(icon);
         gtk_widget_show(applet);
         return 0;