From d994ca499dbfdde87ed242349acdad6fbd8ba274 Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Tue, 19 Feb 2013 10:56:35 +0000 Subject: [PATCH] Fix _basic_create prototype & function to use the dialog now. Call function of randr widget to get the min required size, and set the list widget to that size. Tell the dialog to show centered on the screen. Signed-off-by: Christopher Michael SVN revision: 84146 --- src/modules/conf_randr/e_int_config_randr.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/modules/conf_randr/e_int_config_randr.c b/src/modules/conf_randr/e_int_config_randr.c index bb00430be..575dee1b5 100644 --- a/src/modules/conf_randr/e_int_config_randr.c +++ b/src/modules/conf_randr/e_int_config_randr.c @@ -12,7 +12,7 @@ struct _E_Config_Dialog_Data /* local function prototypes */ static void *_create_data(E_Config_Dialog *cfd EINA_UNUSED); static void _free_data(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata); -static Evas_Object *_basic_create(E_Config_Dialog *cfd EINA_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 int _basic_apply(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata EINA_UNUSED); /* public functions */ @@ -42,7 +42,6 @@ e_int_config_randr(E_Container *con, const char *params EINA_UNUSED) "E", "screen/screen_setup", "preferences-system-screen-resolution", 0, v, NULL); - e_dialog_resizable_set(cfd->dia, 1); return cfd; } @@ -75,7 +74,7 @@ _free_data(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata) } static Evas_Object * -_basic_create(E_Config_Dialog *cfd EINA_UNUSED, Evas *evas, E_Config_Dialog_Data *cfdata) +_basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata) { Evas_Object *o; @@ -85,6 +84,8 @@ _basic_create(E_Config_Dialog *cfd EINA_UNUSED, Evas *evas, E_Config_Dialog_Data /* try to create randr smart widget */ if ((cfdata->o_randr = e_smart_randr_add(evas))) { + Evas_Coord mw = 0, mh = 0; + /* tell randr widget to calculate virtual size */ e_smart_randr_virtual_size_calc(cfdata->o_randr); @@ -93,8 +94,17 @@ _basic_create(E_Config_Dialog *cfd EINA_UNUSED, Evas *evas, E_Config_Dialog_Data /* append randr widget to list object */ e_widget_list_object_append(o, cfdata->o_randr, 1, 1, 0.5); + + /* ask randr widget to calculate min size */ + e_smart_randr_min_size_get(cfdata->o_randr, &mw, &mh); + + /* set min size of the list widget */ + e_widget_size_min_set(o, mw, mh); } + e_util_win_auto_resize_fill(cfd->dia->win); + e_win_centered_set(cfd->dia->win, 1); + return o; }