comparison src/statusicon/si.c @ 914:d12d27887bf0 trunk

[svn] - statusicon: smarter show/hide on statusicon click (plugin will now correctly handle the situation where the player window is always hidden and the playlist window should be shown/hidden)
author giacomo
date Wed, 04 Apr 2007 11:49:12 -0700
parents fbf1f593b0c6
children 1ccc7a9c7fc2
comparison
equal deleted inserted replaced
913:4fbe6bd78021 914:d12d27887bf0
82 82
83 83
84 void 84 void
85 si_audacious_toggle_visibility ( void ) 85 si_audacious_toggle_visibility ( void )
86 { 86 {
87 static gboolean mw_prevstatus = FALSE;
87 static gboolean eq_prevstatus = FALSE; 88 static gboolean eq_prevstatus = FALSE;
88 static gboolean pl_prevstatus = FALSE; 89 static gboolean pl_prevstatus = FALSE;
89 90
90 /* use the main window visibility status to toggle show/hide */ 91 /* use the window visibility status to toggle show/hide
91 if ( xmms_remote_is_main_win( si_gp.xmms_session ) == TRUE ) 92 (if at least one is visible, hide) */
93 if (( xmms_remote_is_main_win( si_gp.xmms_session ) == TRUE ) ||
94 ( xmms_remote_is_eq_win( si_gp.xmms_session ) == TRUE ) ||
95 ( xmms_remote_is_pl_win( si_gp.xmms_session ) == TRUE ))
92 { 96 {
93 /* remember the visibility status of equalizer and playlist windows */ 97 /* remember the visibility status of the player windows */
98 mw_prevstatus = xmms_remote_is_main_win( si_gp.xmms_session );
94 eq_prevstatus = xmms_remote_is_eq_win( si_gp.xmms_session ); 99 eq_prevstatus = xmms_remote_is_eq_win( si_gp.xmms_session );
95 pl_prevstatus = xmms_remote_is_pl_win( si_gp.xmms_session ); 100 pl_prevstatus = xmms_remote_is_pl_win( si_gp.xmms_session );
96 /* now hide all of the player windows */ 101 /* now hide all of them */
97 xmms_remote_main_win_toggle( si_gp.xmms_session , FALSE ); 102 if ( mw_prevstatus == TRUE )
103 xmms_remote_main_win_toggle( si_gp.xmms_session , FALSE );
98 if ( eq_prevstatus == TRUE ) 104 if ( eq_prevstatus == TRUE )
99 xmms_remote_eq_win_toggle( si_gp.xmms_session , FALSE ); 105 xmms_remote_eq_win_toggle( si_gp.xmms_session , FALSE );
100 if ( pl_prevstatus == TRUE ) 106 if ( pl_prevstatus == TRUE )
101 xmms_remote_pl_win_toggle( si_gp.xmms_session , FALSE ); 107 xmms_remote_pl_win_toggle( si_gp.xmms_session , FALSE );
102 } 108 }
103 else 109 else
104 { 110 {
105 /* show the main player window again */ 111 /* show the windows that were visible before */
106 xmms_remote_main_win_toggle( si_gp.xmms_session , TRUE ); 112 if ( mw_prevstatus == TRUE )
107 /* show the equalizer and playlist window if they were visible before */ 113 xmms_remote_main_win_toggle( si_gp.xmms_session , TRUE );
108 if ( eq_prevstatus == TRUE ) 114 if ( eq_prevstatus == TRUE )
109 xmms_remote_eq_win_toggle( si_gp.xmms_session , TRUE ); 115 xmms_remote_eq_win_toggle( si_gp.xmms_session , TRUE );
110 if ( pl_prevstatus == TRUE ) 116 if ( pl_prevstatus == TRUE )
111 xmms_remote_pl_win_toggle( si_gp.xmms_session , TRUE ); 117 xmms_remote_pl_win_toggle( si_gp.xmms_session , TRUE );
112 } 118 }