From e65343f50ce20060c5209d052a36a614fc4026d2 Mon Sep 17 00:00:00 2001 From: Olliver Schinagl Date: Tue, 16 Jun 2015 08:43:20 +0200 Subject: [griffin.hmi] use new and updated menu-widget using buttons, checkboxes and radio buttons Signed-off-by: Olliver Schinagl --- src/eulogium.c | 18 +++++++++++------- src/eulogium.h | 5 ++++- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/eulogium.c b/src/eulogium.c index cd3fa62..85dd652 100644 --- a/src/eulogium.c +++ b/src/eulogium.c @@ -331,7 +331,7 @@ static struct menu_def menu_system_settings = { { .icon = "user-home", .label = gettext_noop("Return"), - .end = NULL, + .item = {.type = LIST_ITEM_BUTTON}, .footer = gettext_noop("Return to Main menu"), .footer_alt = NULL, .func = &_cb_content_prev_set, @@ -340,7 +340,7 @@ static struct menu_def menu_system_settings = { }, { .icon = NULL, .label = "Language", - .end = NULL, + .item = {.type = LIST_ITEM_BUTTON}, .footer = "Change language", .footer_alt = NULL, .func = &_but_settings_language_cb, @@ -349,7 +349,7 @@ static struct menu_def menu_system_settings = { }, { .icon = NULL, .label = "Network", - .end = NULL, + .item = {.type = LIST_ITEM_BUTTON}, .footer = "Manage connectivity", .footer_alt = "WiFi & Ethernet", .func = &_but_settings_network_cb, @@ -358,7 +358,7 @@ static struct menu_def menu_system_settings = { }, { .icon = NULL, .label = "Hot end 1 offset", - .end = NULL, + .item = {.type = LIST_ITEM_BUTTON}, .footer = "Adjust offset", .footer_alt = NULL, .func = &_but_settings_hotend_1_offset_cb, @@ -465,7 +465,7 @@ static struct menu_def menu_settings_network = { { .icon = "user-home", .label = "Return", - .end = NULL, + .item = {.type = LIST_ITEM_BUTTON}, .footer = "Return to Main menu", .footer_alt = NULL, .func = &_cb_content_prev_set, @@ -492,7 +492,11 @@ static struct menu_def menu_settings_network = { }, { .icon = NULL, .label = "WiFi", - .end = EINA_TRUE, + .item = { + .type = LIST_ITEM_CHECK, + .state = EINA_FALSE, + }, + .end = NULL, .footer = NULL, .footer_alt = NULL, .func = NULL, @@ -2380,7 +2384,7 @@ static void _menu_generate_menulist(struct eulogium_data *eulogium, Evas_Object } else { icon = NULL; } - item = eulogium_item_list_append(list, icon, entry[i].label, NULL, entry[i].func, eulogium); /*XXX TODO pass data from struct */ + item = eulogium_item_list_append(list, icon, entry[i].label, &entry[i].item, entry[i].func, eulogium); entry[i].data = eulogium->footer; /* XXX ugly-ness keeps adding. The footer widget should not be passed like this :( */ evas_object_smart_callback_add(item, "focused", _update_menu_footer_focus_cb, &entry[i]); evas_object_smart_callback_add(item, "unfocused", _update_menu_footer_unfocus_cb, &entry[i]); diff --git a/src/eulogium.h b/src/eulogium.h index 186258e..f46d22f 100644 --- a/src/eulogium.h +++ b/src/eulogium.h @@ -7,6 +7,8 @@ #include #include +#include "eulogium_item_list.h" + enum screen_type { NONE, FUNC, @@ -114,7 +116,8 @@ struct button_def { struct menu_entry_def { const char *icon; const char *label; - Eina_Bool end; + struct list_item item; + Eina_Bool *end; /* remove me */ const char *footer; /* Primary footer */ const char *footer_alt; /* Alternating footer */ Ecore_Timer *toggle_timer; -- cgit v0.12