Esempio n. 1
0
gboolean tray_appindicator_create(gpointer data)
{
  if (is_exist_tray_appindicator())
    return FALSE;

  if (tray_appindicator) {
    if (app_indicator_get_status (tray_appindicator) != APP_INDICATOR_STATUS_ACTIVE) {
      app_indicator_set_status (tray_appindicator, APP_INDICATOR_STATUS_ACTIVE);
      destroy_other_tray();
    }
  } else {
    destroy_other_tray();

    if (!tray_appindicator_load_icon(HIME_TRAY_PNG, HIME_TRAY_PNG, iconame, icondir))
      return FALSE;

    tray_appindicator = app_indicator_new_with_path ("hime", iconame, APP_INDICATOR_CATEGORY_APPLICATION_STATUS, icondir);
    if(tray_appindicator == NULL)
      return TRUE;

    app_indicator_set_status (tray_appindicator, APP_INDICATOR_STATUS_ACTIVE);
    GtkWidget *menu = NULL;
    menu = create_tray_menu(mitems);
    app_indicator_set_secondary_activate_target(tray_appindicator, mitems[0].item);
    app_indicator_set_menu (tray_appindicator, GTK_MENU (menu));
  }

  load_tray_appindicator();
  return FALSE;
}
Esempio n. 2
0
void load_tray_appindicator()
{
  if (!hime_status_tray)
    return;
  if (!is_exist_tray_appindicator()) {
    init_tray_appindicator();
    return;
  }

  app_indicator_set_label(tray_appindicator, tray_appindicator_label_create(), " / ");
  tray_appindicator_update_icon();
}
Esempio n. 3
0
File: eve.c Progetto: Tetralet/hime
void destroy_tray()
{
// TODO: optimze it , e.g. struct
  if (is_exist_tray())
    destroy_tray_icon();
  if (is_exist_tray_double())
    destroy_tray_double();
#if TRAY_UNITY
  if (is_exist_tray_appindicator())
    destroy_tray_appindicator();
#endif
}
Esempio n. 4
0
File: eve.c Progetto: Tetralet/hime
void destroy_other_tray()
{
  if (!hime_status_tray) {
    destroy_tray();
    return;
  }
  if (is_exist_tray() && hime_tray_display != HIME_TRAY_DISPLAY_SINGLE)
    destroy_tray_icon();
  if (is_exist_tray_double() && hime_tray_display != HIME_TRAY_DISPLAY_DOUBLE)
    destroy_tray_double();
#if TRAY_UNITY
  if (is_exist_tray_appindicator() && hime_tray_display != HIME_TRAY_DISPLAY_APPINDICATOR)
    destroy_tray_appindicator();
#endif
}