forked from enlightenment/enlightenment
Make config dialog listen on "changed" signal from RandR smart object
to enable Apply button. NB: Cannot use basic->check_changed here as the Monitor smart objects do the changing, but the Randr smart object never does. Since "check_changed" only listens on the main dialog widget (randr smart object in this case), then the "check_changed" of dialog_view would not work in this case. Signed-off-by: Christopher Michael <cp.michael@samsung.com> SVN revision: 77569
This commit is contained in:
parent
1405f6f949
commit
38d31cf0c0
|
@ -15,7 +15,8 @@ static void *_create_data(E_Config_Dialog *cfd __UNUSED__);
|
|||
static void _fill_data(E_Config_Dialog_Data *cfdata);
|
||||
static void _free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata);
|
||||
static int _basic_apply(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata);
|
||||
static Evas_Object *_basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data *cfdata);
|
||||
static Evas_Object *_basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
|
||||
static void _randr_cb_changed(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__);
|
||||
|
||||
/* local variables */
|
||||
|
||||
|
@ -36,6 +37,7 @@ e_int_config_randr(E_Container *con, const char *params __UNUSED__)
|
|||
v->free_cfdata = _free_data;
|
||||
v->basic.create_widgets = _basic_create;
|
||||
v->basic.apply_cfdata = _basic_apply;
|
||||
|
||||
v->override_auto_apply = EINA_TRUE;
|
||||
|
||||
cfd = e_config_dialog_new(con, _("Screen Setup"),
|
||||
|
@ -69,6 +71,10 @@ _fill_data(E_Config_Dialog_Data *cfdata)
|
|||
static void
|
||||
_free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
evas_object_smart_callback_del(cfdata->o_scroll, "changed",
|
||||
_randr_cb_changed);
|
||||
evas_object_del(cfdata->o_scroll);
|
||||
|
||||
E_FREE(cfdata);
|
||||
}
|
||||
|
||||
|
@ -79,7 +85,7 @@ _basic_apply(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
|
|||
}
|
||||
|
||||
static Evas_Object *
|
||||
_basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data *cfdata)
|
||||
_basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
Evas_Object *o;
|
||||
Eina_List *l;
|
||||
|
@ -93,6 +99,9 @@ _basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data
|
|||
E_RANDR_12->max_size.height);
|
||||
evas_object_show(cfdata->o_scroll);
|
||||
|
||||
evas_object_smart_callback_add(cfdata->o_scroll, "changed",
|
||||
_randr_cb_changed, cfd);
|
||||
|
||||
/* create monitors based on 'CRTCS' */
|
||||
EINA_LIST_FOREACH(E_RANDR_12->crtcs, l, crtc)
|
||||
{
|
||||
|
@ -112,3 +121,12 @@ _basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data
|
|||
|
||||
return o;
|
||||
}
|
||||
|
||||
static void
|
||||
_randr_cb_changed(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
|
||||
{
|
||||
E_Config_Dialog *cfd;
|
||||
|
||||
if (!(cfd = data)) return;
|
||||
e_config_dialog_changed_set(cfd, EINA_TRUE);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue