summaryrefslogtreecommitdiff
path: root/endless
diff options
context:
space:
mode:
authorFelipe Erias Morandeira <femorandeira@igalia.com>2013-06-13 16:54:34 +0100
committerFelipe Erias Morandeira <femorandeira@igalia.com>2013-06-21 14:14:14 +0100
commite3dd4555543b5476ee2b9197bd19f49476aca5d4 (patch)
tree2487a634be7c3f26c03c02309cc4e44130c176e0 /endless
parent45ee1b7fe40c97a539def40c92fd3f6b47279cc6 (diff)
Small changes to EosActionMenu. A more complete example of how to use it in an application, including changes to CSS.
[endlessm/eos-sdk#79]
Diffstat (limited to 'endless')
-rw-r--r--endless/eosactionmenu.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/endless/eosactionmenu.c b/endless/eosactionmenu.c
index 5f44958..6e8fc0a 100644
--- a/endless/eosactionmenu.c
+++ b/endless/eosactionmenu.c
@@ -47,15 +47,24 @@ eos_action_menu_class_init (EosActionMenuClass *klass)
}
static void
-eos_action_menu_init (EosActionMenu *menu)
+eos_action_menu_init (EosActionMenu *self)
{
EosActionMenuPrivate *priv;
+ GtkStyleContext *context;
- menu->priv = EOS_ACTION_MENU_PRIVATE (menu);
- priv = menu->priv;
+ self->priv = EOS_ACTION_MENU_PRIVATE (self);
+ priv = self->priv;
+
+ context = gtk_widget_get_style_context (GTK_WIDGET (self));
+ gtk_style_context_add_class (context, _EOS_STYLE_CLASS_ACTION_MENU);
// TODO : name?
priv->action_group = gtk_action_group_new ("EosActionMenu");
+
+ gtk_widget_set_hexpand (GTK_WIDGET (self), TRUE);
+ gtk_widget_set_vexpand (GTK_WIDGET (self), TRUE);
+ gtk_widget_set_halign (GTK_WIDGET (self), GTK_ALIGN_CENTER);
+ gtk_widget_set_valign (GTK_WIDGET (self), GTK_ALIGN_CENTER);
}
/* ******* LIFECYCLE ******* */
@@ -99,7 +108,7 @@ eos_action_menu_add_action (EosActionMenu *menu,
{
EosActionMenuPrivate *priv;
- g_return_val_if_fail (EOS_IS_ACTION_MENU (menu), NULL);
+ g_return_if_fail (EOS_IS_ACTION_MENU (menu));
priv = menu->priv;
if (action)