Mercurial > pidgin.yaz
comparison src/gnome_applet_mgr.c @ 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 | fd3cc0a28d5d |
children | 98bbfae58fa2 |
comparison
equal
deleted
inserted
replaced
373:1d29321843b0 | 374:7493af3a4ce2 |
---|---|
66 GdkPixmap *icon_away_pm=NULL; | 66 GdkPixmap *icon_away_pm=NULL; |
67 GdkPixmap *icon_away_bm=NULL; | 67 GdkPixmap *icon_away_bm=NULL; |
68 | 68 |
69 static GtkAllocation get_applet_pos(gboolean); | 69 static GtkAllocation get_applet_pos(gboolean); |
70 | 70 |
71 gint sizehint=48; | |
72 | |
71 /*************************************************************** | 73 /*************************************************************** |
72 ** | 74 ** |
73 ** function load_applet_icon | 75 ** function load_applet_icon |
74 ** visibility - private | 76 ** visibility - private |
75 ** | 77 ** |
117 } | 119 } |
118 | 120 |
119 free(path); | 121 free(path); |
120 return result; | 122 return result; |
121 } | 123 } |
124 /*************************************************************** | |
125 ** | |
126 ** function applet_change_pixel_size | |
127 ** visibility - private | |
128 ** | |
129 ** input: | |
130 ** w - applet that called the signal | |
131 ** size - size of panel | |
132 ** data - extra data (in this case NULL) | |
133 ** | |
134 ** description - changes the size of the applet when the panel size | |
135 ** changes | |
136 ** | |
137 ***************************************************************/ | |
138 #ifdef HAVE_PANEL_PIXEL_SIZE | |
139 void applet_change_pixel_size(GtkWidget *w, int size, gpointer data) | |
140 { | |
141 sizehint = size; | |
142 update_pixmaps(); | |
143 } | |
144 #endif | |
122 | 145 |
123 /*************************************************************** | 146 /*************************************************************** |
124 ** | 147 ** |
125 ** function update_applet | 148 ** function update_applet |
126 ** visibility - private | 149 ** visibility - private |
189 } else { | 212 } else { |
190 sprintf(GAIM_GNOME_OFFLINE_ICON, "%s", GAIM_GNOME_PENGUIN_OFFLINE); | 213 sprintf(GAIM_GNOME_OFFLINE_ICON, "%s", GAIM_GNOME_PENGUIN_OFFLINE); |
191 sprintf(GAIM_GNOME_CONNECT_ICON, "%s", GAIM_GNOME_PENGUIN_CONNECT); | 214 sprintf(GAIM_GNOME_CONNECT_ICON, "%s", GAIM_GNOME_PENGUIN_CONNECT); |
192 sprintf(GAIM_GNOME_ONLINE_ICON, "%s", GAIM_GNOME_PENGUIN_ONLINE); | 215 sprintf(GAIM_GNOME_ONLINE_ICON, "%s", GAIM_GNOME_PENGUIN_ONLINE); |
193 } | 216 } |
194 load_applet_icon( GAIM_GNOME_OFFLINE_ICON, 32, 34, | 217 load_applet_icon( GAIM_GNOME_OFFLINE_ICON, (sizehint-16), (sizehint-12), |
195 &icon_offline_pm, &icon_offline_bm ); | 218 &icon_offline_pm, &icon_offline_bm ); |
196 load_applet_icon( GAIM_GNOME_CONNECT_ICON, 32, 34, | 219 load_applet_icon( GAIM_GNOME_CONNECT_ICON, (sizehint-16), (sizehint-12), |
197 &icon_connect_pm, &icon_connect_bm ); | 220 &icon_connect_pm, &icon_connect_bm ); |
198 load_applet_icon( GAIM_GNOME_ONLINE_ICON, 32, 34, | 221 load_applet_icon( GAIM_GNOME_ONLINE_ICON, (sizehint-16), (sizehint-12), |
199 &icon_online_pm, &icon_online_bm ); | 222 &icon_online_pm, &icon_online_bm ); |
200 update_applet((gpointer *)applet); | 223 update_applet((gpointer *)applet); |
224 gtk_widget_set_usize(appletframe, sizehint, sizehint); | |
201 } | 225 } |
202 | 226 |
203 | 227 |
204 /*************************************************************** | 228 /*************************************************************** |
205 ** | 229 ** |
528 if(!applet) g_error(_("Can't create GAIM applet!")); | 552 if(!applet) g_error(_("Can't create GAIM applet!")); |
529 gtk_widget_set_events(applet, gtk_widget_get_events(applet) | | 553 gtk_widget_set_events(applet, gtk_widget_get_events(applet) | |
530 GDK_BUTTON_PRESS_MASK); | 554 GDK_BUTTON_PRESS_MASK); |
531 | 555 |
532 appletframe = gtk_frame_new(NULL); | 556 appletframe = gtk_frame_new(NULL); |
533 | 557 #ifdef HAVE_PANEL_PIXEL_SIZE |
558 gtk_widget_set_usize(appletframe, 5, 5); | |
559 #else | |
534 gtk_widget_set_usize(appletframe, 48, 48); | 560 gtk_widget_set_usize(appletframe, 48, 48); |
535 | 561 #endif |
536 | 562 |
537 /*load offline icon*/ | 563 /*load offline icon*/ |
538 load_applet_icon( GAIM_GNOME_OFFLINE_ICON, 32, 32, | 564 load_applet_icon( GAIM_GNOME_OFFLINE_ICON, 32, 32, |
539 &icon_offline_pm, &icon_offline_bm ); | 565 &icon_offline_pm, &icon_offline_bm ); |
540 | 566 |
588 applet_show_about, | 614 applet_show_about, |
589 NULL); | 615 NULL); |
590 | 616 |
591 gtk_signal_connect( GTK_OBJECT(applet), "button_press_event", GTK_SIGNAL_FUNC( AppletClicked), NULL); | 617 gtk_signal_connect( GTK_OBJECT(applet), "button_press_event", GTK_SIGNAL_FUNC( AppletClicked), NULL); |
592 | 618 |
619 #ifdef HAVE_PANEL_PIXEL_SIZE | |
620 gtk_signal_connect(GTK_OBJECT(applet), "change_pixel_size", | |
621 GTK_SIGNAL_FUNC(applet_change_pixel_size), NULL); | |
622 #endif | |
623 | |
593 gtk_widget_show(icon); | 624 gtk_widget_show(icon); |
594 gtk_widget_show(applet); | 625 gtk_widget_show(applet); |
595 return 0; | 626 return 0; |
596 } | 627 } |
597 | 628 |