ngc891 pushed a commit to branch master. http://git.enlightenment.org/games/elemines.git/commit/?id=cadeb02eeec1bff9c2fc9d15d9020c1cb90244a4
commit cadeb02eeec1bff9c2fc9d15d9020c1cb90244a4 Author: Jerome Pinot <[email protected]> Date: Thu Jan 23 11:44:17 2014 +0900 elemines: add icons to popup windows --- src/gui.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/gui.c b/src/gui.c index 005e22b..e588ced 100644 --- a/src/gui.c +++ b/src/gui.c @@ -51,10 +51,15 @@ static void _show_score(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - Evas_Object *button, *leaderboard; + Evas_Object *icon, *button, *leaderboard; + /* set icon and title of the popup */ game.ui.popup = elm_popup_add(game.ui.window); + evas_object_size_hint_weight_set(game.ui.popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_object_part_text_set(game.ui.popup, "title,text", _("High Scores")); + icon = elm_icon_add(game.ui.popup); + elm_icon_standard_set(icon, "score"); + elm_object_part_content_set(game.ui.popup, "title,icon", icon); /* we use the default layout from etrophy library */ leaderboard = etrophy_score_layout_add(game.ui.popup, @@ -89,11 +94,16 @@ static void _show_config(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - Evas_Object *vbox, *spin, *label, *bt1, *bt2; + Evas_Object *icon, *vbox, *spin, *label, *bt1, *bt2; char buffer[512]; + /* set icon and title of the popup */ game.ui.popup = elm_popup_add(game.ui.window); + evas_object_size_hint_weight_set(game.ui.popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_object_part_text_set(game.ui.popup, "title,text", _("Configuration")); + icon = elm_icon_add(game.ui.popup); + elm_icon_standard_set(icon, "config"); + elm_object_part_content_set(game.ui.popup, "title,icon", icon); vbox = elm_box_add(game.ui.window); elm_box_homogeneous_set(vbox, EINA_FALSE); @@ -146,11 +156,15 @@ static void _show_about(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - Evas_Object *label, *button; + Evas_Object *icon, *label, *button; char buffer[256]; + /* set icon and title of the popup */ game.ui.popup = elm_popup_add(game.ui.window); elm_object_part_text_set(game.ui.popup, "title,text", _("About")); + icon = elm_icon_add(game.ui.popup); + elm_icon_standard_set(icon, "about"); + elm_object_part_content_set(game.ui.popup, "title,icon", icon); /* Construct a formatted label for the about popup */ label = elm_label_add(game.ui.window); --
