diff --git a/src/bin/e_gadcon_popup.c b/src/bin/e_gadcon_popup.c index 9848008ca..1d075cca0 100644 --- a/src/bin/e_gadcon_popup.c +++ b/src/bin/e_gadcon_popup.c @@ -6,14 +6,14 @@ /* local subsystem functions */ static void _e_gadcon_popup_free(E_Gadcon_Popup *pop); static void _e_gadcon_popup_locked_set(E_Gadcon_Popup *pop, Eina_Bool locked); -static void _e_gadcon_popup_size_recalc(E_Gadcon_Popup *pop, Evas_Object *obj, Eina_Bool skip_resize); +static void _e_gadcon_popup_size_recalc(E_Gadcon_Popup *pop, Evas_Object *obj); static void _e_gadcon_popup_position(E_Gadcon_Popup *pop); static void _e_gadcon_popup_changed_size_hints_cb(void *data, Evas *e, Evas_Object *obj, void *event_info); /* externally accessible functions */ EAPI E_Gadcon_Popup * -e_gadcon_popup_new(E_Gadcon_Client *gcc, void (*resize_func) (Evas_Object *obj, int *w, int *h)) +e_gadcon_popup_new(E_Gadcon_Client *gcc) { E_Gadcon_Popup *pop; Evas_Object *o; @@ -37,7 +37,6 @@ e_gadcon_popup_new(E_Gadcon_Client *gcc, void (*resize_func) (Evas_Object *obj, pop->gcc = gcc; pop->gadcon_lock = 1; pop->gadcon_was_locked = 0; - pop->resize_func = resize_func; return pop; } @@ -61,7 +60,7 @@ e_gadcon_popup_content_set(E_Gadcon_Popup *pop, Evas_Object *o) evas_object_event_callback_add(o, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _e_gadcon_popup_changed_size_hints_cb, pop); - _e_gadcon_popup_size_recalc(pop, o, EINA_FALSE); + _e_gadcon_popup_size_recalc(pop, o); } EAPI void @@ -147,7 +146,7 @@ _e_gadcon_popup_locked_set(E_Gadcon_Popup *pop, Eina_Bool locked) } static void -_e_gadcon_popup_size_recalc(E_Gadcon_Popup *pop, Evas_Object *obj, Eina_Bool skip_resize) +_e_gadcon_popup_size_recalc(E_Gadcon_Popup *pop, Evas_Object *obj) { Evas_Coord w = 0, h = 0; @@ -158,7 +157,6 @@ _e_gadcon_popup_size_recalc(E_Gadcon_Popup *pop, Evas_Object *obj, Eina_Bool ski edje_object_size_min_get(obj, &w, &h); edje_object_size_min_restricted_calc(obj, &w, &h, w, h); } - if (pop->resize_func && !skip_resize) pop->resize_func(obj, &w, &h); edje_extern_object_min_size_set(obj, w, h); edje_object_size_min_calc(pop->o_bg, &pop->w, &pop->h); evas_object_resize(pop->o_bg, pop->w, pop->h); @@ -246,5 +244,5 @@ _e_gadcon_popup_changed_size_hints_cb(void *data, Evas *e, Evas_Object *obj, voi { E_Gadcon_Popup *pop = data; - _e_gadcon_popup_size_recalc(pop, obj, EINA_TRUE); + _e_gadcon_popup_size_recalc(pop, obj); } diff --git a/src/bin/e_gadcon_popup.h b/src/bin/e_gadcon_popup.h index a40a3032c..41dc0ad59 100644 --- a/src/bin/e_gadcon_popup.h +++ b/src/bin/e_gadcon_popup.h @@ -23,11 +23,9 @@ struct _E_Gadcon_Popup Eina_Bool pinned : 1; Eina_Bool gadcon_lock : 1; Eina_Bool gadcon_was_locked : 1; - - void (*resize_func) (Evas_Object *obj, int *w, int *h); }; -EAPI E_Gadcon_Popup *e_gadcon_popup_new(E_Gadcon_Client *gcc, void (*resize_func) (Evas_Object *obj, int *w, int *h)); +EAPI E_Gadcon_Popup *e_gadcon_popup_new(E_Gadcon_Client *gcc); EAPI void e_gadcon_popup_content_set(E_Gadcon_Popup *pop, Evas_Object *o); EAPI void e_gadcon_popup_show(E_Gadcon_Popup *pop); EAPI void e_gadcon_popup_hide(E_Gadcon_Popup *pop); diff --git a/src/modules/battery/e_mod_main.c b/src/modules/battery/e_mod_main.c index 7127768eb..566fd9a74 100644 --- a/src/modules/battery/e_mod_main.c +++ b/src/modules/battery/e_mod_main.c @@ -819,8 +819,7 @@ _battery_warning_popup(Instance *inst, int time, double percent) if ((!inst) || (inst->warning)) return; - inst->warning = - e_gadcon_popup_new(inst->gcc, NULL); + inst->warning = e_gadcon_popup_new(inst->gcc); if (!inst->warning) return; e = inst->warning->win->evas; diff --git a/src/modules/connman/e_mod_main.c b/src/modules/connman/e_mod_main.c index 75f184c66..d526f5858 100644 --- a/src/modules/connman/e_mod_main.c +++ b/src/modules/connman/e_mod_main.c @@ -810,20 +810,6 @@ popup_cb_setup(void *data, void *data2) else if_dialog_hide(inst); } -static void -popup_cb_resize(Evas_Object *obj, int *w, int *h) -{ - int mw, mh; - - e_widget_min_size_get(obj, &mw, &mh); - - if (mh < 180) mh = 180; - if (mw < 160) mw = 160; - - if (*w) *w = (mw + 8); - if (*h) *h = (mh + 8); -} - static void popup_ifnet_icon_adjust(Evas_Object *icon, Interface_Network *ifnet) { @@ -1058,7 +1044,7 @@ popup_show(Instance *inst) Evas *evas; Evas_Coord mw, mh; - inst->popup = e_gadcon_popup_new(inst->gcc, popup_cb_resize); + inst->popup = e_gadcon_popup_new(inst->gcc); evas = inst->popup->win->evas; edje_freeze(); @@ -1092,6 +1078,11 @@ popup_show(Instance *inst) e_widget_table_object_append(base, button, 0, 1, 1, 1, 0, 0, 0, 0); + e_widget_min_size_get(base, &mw, &mh); + if (mh < 188) mh = 188; + if (mw < 168) mw = 168; + e_widget_min_size_set(base, mw, mh); + edje_thaw(); e_gadcon_popup_content_set(inst->popup, base); diff --git a/src/modules/mixer/e_mod_main.c b/src/modules/mixer/e_mod_main.c index 06cf72c54..b30de2d46 100644 --- a/src/modules/mixer/e_mod_main.c +++ b/src/modules/mixer/e_mod_main.c @@ -384,18 +384,6 @@ _mixer_popup_cb_mute_change(void *data, Evas_Object *obj, void *event) _mixer_gadget_update(inst); } -static void -_mixer_popup_cb_resize(Evas_Object *obj, int *w, int *h) -{ - int mw, mh; - - e_widget_min_size_get(obj, &mw, &mh); - if (mh < 200) mh = 200; - if (mw < 60) mw = 60; - if (w) *w = (mw + 8); - if (h) *h = (mh + 8); -} - static Evas_Object * _mixer_popup_add_slider(E_Mixer_Instance *inst, int value, void (*cb) (void *data, Evas_Object *obj, void *event_info)) { @@ -554,6 +542,7 @@ _mixer_popup_new(E_Mixer_Instance *inst) { E_Mixer_Channel_State *state; Evas *evas; + Evas_Coord mw, mh; int colspan; if (inst->conf->dialog) @@ -568,7 +557,7 @@ _mixer_popup_new(E_Mixer_Instance *inst) else colspan = 1; - inst->popup = e_gadcon_popup_new(inst->gcc, _mixer_popup_cb_resize); + inst->popup = e_gadcon_popup_new(inst->gcc); evas = inst->popup->win->evas; inst->ui.table = e_widget_table_add(evas, 0); @@ -615,6 +604,11 @@ _mixer_popup_new(E_Mixer_Instance *inst) e_widget_table_object_append(inst->ui.table, inst->ui.button, 0, 7, colspan, 1, 1, 1, 1, 0); + e_widget_min_size_get(inst->ui.table, &mw, &mh); + if (mh < 208) mh = 208; + if (mw < 68) mw = 68; + e_widget_min_size_set(inst->ui.table, mw, mh); + e_gadcon_popup_content_set(inst->popup, inst->ui.table); e_gadcon_popup_show(inst->popup); _mixer_popup_input_window_create(inst);