# HG changeset patch # User Eric Warmenhoven # Date 960327200 0 # Node ID 0d9cfc3579a5a2c04f9d93b33ee0afd336f4550f # Parent 4c500ceeeb0f872b241979b1221b326295ad241e [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 diff -r 4c500ceeeb0f -r 0d9cfc3579a5 src/buddy.c --- a/src/buddy.c Tue Jun 06 10:21:24 2000 +0000 +++ b/src/buddy.c Tue Jun 06 21:33:20 2000 +0000 @@ -287,8 +287,10 @@ } void gnome_buddy_set_pos( gint x, gint y ){ - if (general_options & OPT_GEN_SAVED_WINDOWS) + if (general_options & OPT_GEN_NEAR_APPLET) gtk_widget_set_uposition ( blist, x, y ); + else if (general_options & OPT_GEN_SAVED_WINDOWS) + gtk_widget_set_uposition(blist, blist_pos.x - blist_pos.xoff, blist_pos.y - blist_pos.yoff); } GtkRequisition gnome_buddy_get_dimentions(){ diff -r 4c500ceeeb0f -r 0d9cfc3579a5 src/gaim.h --- a/src/gaim.h Tue Jun 06 10:21:24 2000 +0000 +++ b/src/gaim.h Tue Jun 06 21:33:20 2000 +0000 @@ -348,7 +348,7 @@ #define TYPE_SIGNOFF 4 #define TYPE_KEEPALIVE 5 -#define REVISION "gaim:$Revision: 348 $" +#define REVISION "gaim:$Revision: 350 $" #define FLAPON "FLAPON\r\n\r\n" #define ROAST "Tic/Toc" @@ -424,7 +424,7 @@ #define OPT_GEN_BROWSER_POPUP 0x00000800 #define OPT_GEN_SAVED_WINDOWS 0x00001000 #define OPT_GEN_DISCARD_WHEN_AWAY 0x00002000 -#define OPT_GEN_CHECK_VERSIONS 0x00004000 +#define OPT_GEN_NEAR_APPLET 0x00004000 #define OPT_GEN_CHECK_SPELLING 0x00008000 extern int display_options; diff -r 4c500ceeeb0f -r 0d9cfc3579a5 src/gaimrc.c --- a/src/gaimrc.c Tue Jun 06 10:21:24 2000 +0000 +++ b/src/gaimrc.c Tue Jun 06 21:33:20 2000 +0000 @@ -529,7 +529,8 @@ OPT_GEN_ENTER_SENDS | OPT_GEN_SAVED_WINDOWS | OPT_GEN_REMEMBER_PASS | - OPT_GEN_REGISTERED; + OPT_GEN_REGISTERED | + OPT_GEN_NEAR_APPLET; display_options = OPT_DISP_SHOW_IDLETIME | OPT_DISP_SHOW_TIME | diff -r 4c500ceeeb0f -r 0d9cfc3579a5 src/gnome_applet_mgr.c --- a/src/gnome_applet_mgr.c Tue Jun 06 10:21:24 2000 +0000 +++ b/src/gnome_applet_mgr.c Tue Jun 06 21:33:20 2000 +0000 @@ -63,6 +63,8 @@ GdkPixmap *icon_away_pm=NULL; GdkPixmap *icon_away_bm=NULL; +static GtkAllocation get_applet_pos(gboolean); + /*************************************************************** ** ** function load_applet_icon @@ -227,10 +229,13 @@ ** description - I guess it shows the login dialog ** ****************************************************************/ - +extern GtkWidget *mainwindow; void applet_show_login(AppletWidget *widget, gpointer data) { - /* FIXME : this is so pointless */ show_login(); + if (general_options & OPT_GEN_NEAR_APPLET) { + GtkAllocation a = get_applet_pos(FALSE); + gtk_widget_set_uposition(mainwindow, a.x, a.y); + } } void insert_applet_away() { @@ -349,14 +354,17 @@ ** of the Gnome panel. ** ****************************************************************/ -GtkAllocation get_applet_pos(){ +GtkAllocation get_applet_pos(gboolean for_blist) { gint x,y,pad; GtkRequisition buddy_req, applet_req; GtkAllocation result; GNOME_Panel_OrientType orient = applet_widget_get_panel_orient( APPLET_WIDGET(applet) ); pad = 5; gdk_window_get_position(gtk_widget_get_parent_window(appletframe), &x, &y); - buddy_req = gnome_buddy_get_dimentions(); + if (for_blist) + buddy_req = gnome_buddy_get_dimentions(); + else + buddy_req = mainwindow->requisition; applet_req = appletframe->requisition; switch( orient ){ case ORIENT_UP: @@ -397,7 +405,7 @@ void createOnlinePopup(){ GtkAllocation al; make_buddy(); - al = get_applet_pos(); + al = get_applet_pos(TRUE); gnome_buddy_set_pos( al.x, al.y ); } diff -r 4c500ceeeb0f -r 0d9cfc3579a5 src/prefs.c --- a/src/prefs.c Tue Jun 06 10:21:24 2000 +0000 +++ b/src/prefs.c Tue Jun 06 21:33:20 2000 +0000 @@ -310,7 +310,6 @@ GtkWidget *fontbox; GtkWidget *fontframe; GtkWidget *appbox; - GtkWidget *appletbox; GtkWidget *away_topbox; GtkWidget *away_botbox; GtkWidget *add_away; @@ -329,6 +328,7 @@ #endif #ifdef USE_APPLET GtkWidget *applet_page; + GtkWidget *appletbox; #endif GtkWidget *label; GtkWidget *browseropt; @@ -438,6 +438,7 @@ gaim_button("Automatically Show Buddy List", &general_options, OPT_GEN_APP_BUDDY_SHOW, appletbox); gaim_button("Sounds go through GNOME", &sound_options, OPT_SOUND_THROUGH_GNOME, appletbox); + gaim_button("Buddy list displays near the applet", &general_options, OPT_GEN_NEAR_APPLET, appletbox); gtk_widget_show(appletbox); gtk_widget_show(applet_page);