Changeset 10938


Ignore:
Timestamp:
Jul 4, 2010, 6:27:03 PM (12 years ago)
Author:
charles
Message:

(trunk gtk) have the GtkStatusIcon? code use the same icon fallback scheme as the AppInd? code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/tr-icon.c

    r10937 r10938  
    125125#endif
    126126
    127 #ifdef HAVE_LIBAPPINDICATOR
    128 gpointer
    129 tr_icon_new( TrCore * core)
     127static const char *
     128getIconName( void )
    130129{
    131     GtkWidget * w;
    132130    const char * icon_name;
    133     AppIndicator * indicator;
     131
    134132    GtkIconTheme * theme = gtk_icon_theme_get_default( );
    135133
     
    145143    }
    146144
    147     indicator = app_indicator_new( MY_NAME, icon_name, APP_INDICATOR_CATEGORY_SYSTEM_SERVICES );
     145    return icon_name;
     146}
     147
     148#ifdef HAVE_LIBAPPINDICATOR
     149gpointer
     150tr_icon_new( TrCore * core)
     151{
     152    GtkWidget * w;
     153    const char * icon_name = getIconName( );
     154    AppIndicator * indicator = app_indicator_new( MY_NAME, icon_name, APP_INDICATOR_CATEGORY_SYSTEM_SERVICES );
    148155    app_indicator_set_status( indicator, APP_INDICATOR_STATUS_ACTIVE );
    149156    w = action_get_widget( "/icon-popup" );
    150157    app_indicator_set_menu( indicator, GTK_MENU ( w ) );
    151 
    152158    g_object_set_data( G_OBJECT( indicator ), "tr-core", core );
    153 
    154159    return indicator;
    155160}
     
    158163tr_icon_new( TrCore * core )
    159164{
    160     const char * icon_name = TRAY_ICON;
     165    const char * icon_name = getIconName( );
    161166    GtkStatusIcon * icon = gtk_status_icon_new_from_icon_name( icon_name );
    162 
    163167    g_signal_connect( icon, "activate", G_CALLBACK( activated ), NULL );
    164168    g_signal_connect( icon, "popup-menu", G_CALLBACK( popup ), NULL );
Note: See TracChangeset for help on using the changeset viewer.