Mercurial > pidgin.yaz
comparison src/gnome_applet_mgr.c @ 340:0d9cfc3579a5
[gaim-migrate @ 350]
More changes to the applet. Now, you can have it remember the position and
not have it near the applet, or not remember the position and not near the
applet, or near the applet. Also, if you want it near the applet, the login
box will appear near the applet.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Tue, 06 Jun 2000 21:33:20 +0000 |
parents | 9d258a0aa560 |
children | f4fba304b236 |
comparison
equal
deleted
inserted
replaced
339:4c500ceeeb0f | 340:0d9cfc3579a5 |
---|---|
60 GdkPixmap *icon_msg_pending_pm=NULL; | 60 GdkPixmap *icon_msg_pending_pm=NULL; |
61 GdkPixmap *icon_msg_pending_bm=NULL; | 61 GdkPixmap *icon_msg_pending_bm=NULL; |
62 | 62 |
63 GdkPixmap *icon_away_pm=NULL; | 63 GdkPixmap *icon_away_pm=NULL; |
64 GdkPixmap *icon_away_bm=NULL; | 64 GdkPixmap *icon_away_bm=NULL; |
65 | |
66 static GtkAllocation get_applet_pos(gboolean); | |
65 | 67 |
66 /*************************************************************** | 68 /*************************************************************** |
67 ** | 69 ** |
68 ** function load_applet_icon | 70 ** function load_applet_icon |
69 ** visibility - private | 71 ** visibility - private |
225 ** | 227 ** |
226 ** | 228 ** |
227 ** description - I guess it shows the login dialog | 229 ** description - I guess it shows the login dialog |
228 ** | 230 ** |
229 ****************************************************************/ | 231 ****************************************************************/ |
230 | 232 extern GtkWidget *mainwindow; |
231 void applet_show_login(AppletWidget *widget, gpointer data) { | 233 void applet_show_login(AppletWidget *widget, gpointer data) { |
232 /* FIXME : this is so pointless */ | |
233 show_login(); | 234 show_login(); |
235 if (general_options & OPT_GEN_NEAR_APPLET) { | |
236 GtkAllocation a = get_applet_pos(FALSE); | |
237 gtk_widget_set_uposition(mainwindow, a.x, a.y); | |
238 } | |
234 } | 239 } |
235 | 240 |
236 void insert_applet_away() { | 241 void insert_applet_away() { |
237 GList *awy = away_messages; | 242 GList *awy = away_messages; |
238 struct away_message *a; | 243 struct away_message *a; |
347 ** should be placed based on the position | 352 ** should be placed based on the position |
348 ** of the applet and the orientation | 353 ** of the applet and the orientation |
349 ** of the Gnome panel. | 354 ** of the Gnome panel. |
350 ** | 355 ** |
351 ****************************************************************/ | 356 ****************************************************************/ |
352 GtkAllocation get_applet_pos(){ | 357 GtkAllocation get_applet_pos(gboolean for_blist) { |
353 gint x,y,pad; | 358 gint x,y,pad; |
354 GtkRequisition buddy_req, applet_req; | 359 GtkRequisition buddy_req, applet_req; |
355 GtkAllocation result; | 360 GtkAllocation result; |
356 GNOME_Panel_OrientType orient = applet_widget_get_panel_orient( APPLET_WIDGET(applet) ); | 361 GNOME_Panel_OrientType orient = applet_widget_get_panel_orient( APPLET_WIDGET(applet) ); |
357 pad = 5; | 362 pad = 5; |
358 gdk_window_get_position(gtk_widget_get_parent_window(appletframe), &x, &y); | 363 gdk_window_get_position(gtk_widget_get_parent_window(appletframe), &x, &y); |
359 buddy_req = gnome_buddy_get_dimentions(); | 364 if (for_blist) |
365 buddy_req = gnome_buddy_get_dimentions(); | |
366 else | |
367 buddy_req = mainwindow->requisition; | |
360 applet_req = appletframe->requisition; | 368 applet_req = appletframe->requisition; |
361 switch( orient ){ | 369 switch( orient ){ |
362 case ORIENT_UP: | 370 case ORIENT_UP: |
363 result.x=x; | 371 result.x=x; |
364 result.y=y-(buddy_req.height+pad); | 372 result.y=y-(buddy_req.height+pad); |
395 | 403 |
396 | 404 |
397 void createOnlinePopup(){ | 405 void createOnlinePopup(){ |
398 GtkAllocation al; | 406 GtkAllocation al; |
399 make_buddy(); | 407 make_buddy(); |
400 al = get_applet_pos(); | 408 al = get_applet_pos(TRUE); |
401 gnome_buddy_set_pos( al.x, al.y ); | 409 gnome_buddy_set_pos( al.x, al.y ); |
402 } | 410 } |
403 | 411 |
404 | 412 |
405 void createPendingPopup(){ | 413 void createPendingPopup(){ |