void menumgr_destroy(struct menumgr *m);
/**
+* @brief Changes the style of a button and sets status function.
+*
+* @param[in] m Menu manager pointer.
+* @param[in] status Status function pointer.
+* @param[in] id Index of the button.
+* @param[in] style Style to be set on the button.
+*/
+void menumgr_style_set(struct menumgr *m, char *(*status)(void *data, int id), int id, const char *style);
+
+/**
* @brief Updates a Menu manager.
*
* @param[in] m Menu manager pointer.
.focused = _focused
};
+void menumgr_style_set(struct menumgr *m, char *(*status)(void *data, int id), int id, const char *style)
+{
+ if (!m) {
+ _ERR("Invalid parameter.");
+ return;
+ }
+
+ m->info[id]->status = status;
+ elm_object_style_set(m->btn[id], style);
+}
+
void menumgr_update(struct menumgr *m)
{
int i;
return false;
}
+static void update_style(struct _priv *priv)
+{
+ char *str = NULL;
+ str = _get_connected_ap(priv, TYPE_WIRELESS);
+ if (!str) {
+ menumgr_style_set(priv->menu, NULL, TYPE_WIRELESS, STYLE_NORMAL_BTN);
+ } else {
+ menumgr_style_set(priv->menu, _get_connected_ap, TYPE_WIRELESS, STYLE_STATUS_BTN);
+ free(str);
+ }
+}
+
static void _show(void *layout_data)
{
struct _priv *priv;
// if (priv->cur_type == TYPE_WIRELESS)
// _retry_wireless_network(priv);
}
+ update_style(priv);
menumgr_update(priv->menu);
}
elm_object_disabled_set(priv->ly, EINA_FALSE);
break;
case UPDATE_CONTENT:
+ update_style(priv);
menumgr_update(priv->menu);
break;
default: