Exemple #1
0
static void
shell_status_menu_init (ShellStatusMenu *status)
{
  ShellStatusMenuPrivate *priv;

  status->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE (status, SHELL_TYPE_STATUS_MENU,
                                                     ShellStatusMenuPrivate);

  g_object_set (G_OBJECT (status),
                "orientation", BIG_BOX_ORIENTATION_HORIZONTAL,
                NULL);
  priv->client = gconf_client_get_default ();

  priv->user_icon = CLUTTER_TEXTURE (clutter_texture_new ());
  big_box_append (BIG_BOX (status), CLUTTER_ACTOR (status->priv->user_icon), 0);

  priv->name_box = BIG_BOX (big_box_new (BIG_BOX_ORIENTATION_VERTICAL));
  g_object_set (G_OBJECT (priv->name_box), "y-align", BIG_BOX_ALIGNMENT_CENTER, NULL);
  big_box_append (BIG_BOX (status), CLUTTER_ACTOR (priv->name_box), BIG_BOX_PACK_EXPAND);
  priv->name = CLUTTER_TEXT (clutter_text_new ());
  big_box_append (BIG_BOX (priv->name_box), CLUTTER_ACTOR (priv->name), BIG_BOX_PACK_EXPAND);

  priv->manager = gdm_user_manager_ref_default ();
  setup_current_user (status);

  create_sub_menu (status);
}
Exemple #2
0
/**
 * shell_menu_append_separator:
 * @box:
 * @separator: An actor which functions as a menu separator
 * @flags: Packing flags
 *
 * Actors added to the menu with default functions are treated like
 * menu items; this function will add an actor that should instead
 * be treated like a menu separator.  The current practical effect
 * is that the separators will not be selectable.
 */
void
shell_menu_append_separator (ShellMenu         *box,
                             ClutterActor      *separator,
                             BigBoxPackFlags    flags)
{
  g_object_set_data (G_OBJECT (separator), "shell-is-separator", GUINT_TO_POINTER(TRUE));
  big_box_append (BIG_BOX (box), separator, flags);
}