if (sd->obj) evas_object_del(sd->obj);
sd->obj = edje_object_add(evas_object_evas_get(obj));
edje_object_file_set(sd->obj, file, part);
+ evas_object_smart_member_add(sd->obj, obj);
_e_icon_smart_reconfigure(sd);
}
/* smart code here */
if (sd->obj) evas_object_del(sd->obj);
sd->obj = o;
+ evas_object_smart_member_add(sd->obj, obj);
_e_icon_smart_reconfigure(sd);
}
int iw, ih;
Evas_Coord x, y, w, h;
- ih = 0;
- ih = 0;
if (!strcmp(evas_object_type_get(sd->obj), "edje"))
- edje_object_size_min_calc(sd->obj, &iw, &ih);
- else
- evas_object_image_size_get(sd->obj, &iw, &ih);
- if (iw < 1) iw = 1;
- if (ih < 1) ih = 1;
-
- if (sd->fill_inside)
{
w = sd->w;
- h = ((double)ih * w) / (double)iw;
- if (h > sd->h)
- {
- h = sd->h;
- w = ((double)iw * h) / (double)ih;
- }
+ h = sd->h;
+ x = sd->x;
+ y = sd->y;
+ evas_object_move(sd->obj, x, y);
+ evas_object_resize(sd->obj, w, h);
}
else
{
- w = sd->w;
- h = ((double)ih * w) / (double)iw;
- if (h < sd->h)
+ ih = 0;
+ ih = 0;
+ evas_object_image_size_get(sd->obj, &iw, &ih);
+ if (iw < 1) iw = 1;
+ if (ih < 1) ih = 1;
+
+ if (sd->fill_inside)
{
- h = sd->h;
- w = ((double)iw * h) / (double)ih;
- }
+ w = sd->w;
+ h = ((double)ih * w) / (double)iw;
+ if (h > sd->h)
+ {
+ h = sd->h;
+ w = ((double)iw * h) / (double)ih;
+ }
+ }
+ else
+ {
+ w = sd->w;
+ h = ((double)ih * w) / (double)iw;
+ if (h < sd->h)
+ {
+ h = sd->h;
+ w = ((double)iw * h) / (double)ih;
+ }
+ }
+ x = sd->x + ((sd->w - w) / 2);
+ y = sd->y + ((sd->h - h) / 2);
+ evas_object_move(sd->obj, x, y);
+ evas_object_image_fill_set(sd->obj, 0, 0, w, h);
+ evas_object_resize(sd->obj, w, h);
}
- x = sd->x + ((sd->w - w) / 2);
- y = sd->y + ((sd->h - h) / 2);
- evas_object_move(sd->obj, x, y);
- evas_object_image_fill_set(sd->obj, 0, 0, w, h);
- evas_object_resize(sd->obj, w, h);
}
static void
/* Actual config data we will be playing with whil the dialog is active */
struct _CFData
{
+ E_Config_Dialog *cfd;
/*- BASIC -*/
char *file ;
char *current_file;
CFData *cfdata;
cfdata = E_NEW(CFData, 1);
+ cfdata->cfd = cfd;
_fill_data(cfdata);
return cfdata;
}
void
_e_config_bg_cb_standard(void *data)
{
- E_Cfg_Bg_Data *d;
CFData *cfdata;
- d = data;
- cfdata = d->cfd->cfdata;
+ cfdata = data;
e_widget_image_object_set
- (d->cfd->data,
- e_thumb_evas_object_get(d->file, d->cfd->dia->win->evas, 200, 160, 1));
+ (cfdata->cfd->data,
+ e_thumb_evas_object_get(cfdata->file, cfdata->cfd->dia->win->evas, 200, 160, 1));
if (cfdata->current_file)
{
- if (!strcmp(d->file, cfdata->current_file))
+ if (!strcmp(cfdata->file, cfdata->current_file))
{
- e_dialog_button_disable_num_set(d->cfd->dia, 0, 1);
- e_dialog_button_disable_num_set(d->cfd->dia, 1, 1);
+ e_dialog_button_disable_num_set(cfdata->cfd->dia, 0, 1);
+ e_dialog_button_disable_num_set(cfdata->cfd->dia, 1, 1);
}
}
}
e_widget_table_object_append(o, il, 0, 0, 1, 2, 1, 1, 1, 1);
fr = e_widget_framelist_add(evas, "Preview", 0);
- e_widget_min_size_set(fr, 180, 160);
+ e_widget_min_size_set(fr, 200, 160);
e_widget_table_object_append(o, fr, 1, 0, 1, 1, 1, 1, 1, 1);
e_widget_framelist_object_append(fr, im);
int x, y;
if (!cfdata->file) return 0;
+ z = e_zone_current_get(cfd->con);
+ d = e_desk_current_get(z);
+ e_desk_xy_get(d, &x, &y);
switch (cfdata->bg_method)
{
case BG_SET_DEFAULT_DESK:
- while (e_config->desktop_backgrounds)
- {
- E_Config_Desktop_Background *cfbg;
-
- cfbg = e_config->desktop_backgrounds->data;
- e_bg_del(cfbg->container, cfbg->zone, cfbg->desk_x, cfbg->desk_y);
- }
+ e_bg_del(-1, -1, -1, -1);
+ e_bg_del(-1, z->num, x, y);
+ e_bg_del(z->container->num, -1, x, y);
+ e_bg_del(z->container->num, z->num, x, y);
+ e_bg_del(-1, z->num, -1, -1);
+ e_bg_del(z->container->num, -1, -1, -1);
+ e_bg_del(z->container->num, z->num, -1, -1);
if (e_config->desktop_default_background) evas_stringshare_del(e_config->desktop_default_background);
e_config->desktop_default_background = evas_stringshare_add(cfdata->file);
e_bg_update();
e_config_save_queue();
break;
case BG_SET_THIS_DESK:
- z = e_zone_current_get(cfd->con);
- d = e_desk_current_get(z);
- e_desk_xy_get(d, &x, &y);
e_bg_del(-1, -1, -1, -1);
+ e_bg_del(-1, z->num, x, y);
+ e_bg_del(z->container->num, -1, x, y);
e_bg_del(z->container->num, z->num, x, y);
e_bg_add(z->container->num, z->num, x, y, cfdata->file);
e_bg_update();
e_widget_table_object_append(o, il, 0, 0, 1, 2, 1, 1, 1, 1);
fr = e_widget_framelist_add(evas, "Preview", 0);
- e_widget_min_size_set(fr, 180, 160);
+ e_widget_min_size_set(fr, 200, 160);
e_widget_table_object_append(o, fr, 1, 0, 1, 1, 1, 1, 1, 1);
e_widget_framelist_object_append(fr, im);
rg = e_widget_radio_group_new(&(cfdata->bg_method));
fr = e_widget_framelist_add(evas, "Set Background For", 0);
- e_widget_min_size_set(fr, 180, 160);
+ e_widget_min_size_set(fr, 200, 160);
oc = e_widget_radio_add(evas, _("Default Desktop"), BG_SET_DEFAULT_DESK, rg);
e_widget_framelist_object_append(fr, oc);
Evas_Object *bg = NULL;
char buf[4096];
char *homedir;
+ E_Zone *z;
+ int iw, ih, pw, ph;
homedir = e_user_homedir_get();
if (homedir)
free(homedir);
}
+ z = e_zone_current_get(cfd->con);
+ iw = 48;
+ ih = ((double)z->h * iw) / (double)z->w;
+ if (ih > 48)
+ {
+ ih = 48;
+ iw = ((double)z->w * ih) / (double)z->h;
+ }
+ pw = 160;
+ ph = ((double)z->h * pw) / (double)z->w;
+ if (ph > 120)
+ {
+ ph = 120;
+ pw = ((double)z->w * ph) / (double)z->h;
+ }
+
if (ecore_file_is_dir(buf))
{
Ecore_List *bgs;
{
Evas_Object *o = NULL;
char *noext;
- E_Cfg_Bg_Data *cb_data;
- o = e_thumb_generate_begin(fullbg, 48, 48, evas, &o, NULL, NULL);
+ o = e_thumb_generate_begin(fullbg, iw, ih, evas, &o, NULL, NULL);
noext = ecore_file_strip_ext(bgfile);
- /* FIXME: cb_data is leaked - not freed ever */
- cb_data = E_NEW(E_Cfg_Bg_Data, 1);
- cb_data->cfd = cfd;
- cb_data->file = strdup(fullbg);
- e_widget_ilist_append(il, o, noext, _e_config_bg_cb_standard, cb_data, cb_data->file);
+ e_widget_ilist_append(il, o, noext, _e_config_bg_cb_standard, cfd->cfdata, fullbg);
if ((e_config->desktop_default_background) &&
(!strcmp(e_config->desktop_default_background, fullbg)))
e_widget_ilist_selected_set(il, i);
bg = edje_object_add(evas);
edje_object_file_set(bg, e_config->desktop_default_background, "desktop/background");
- im = e_widget_image_add_from_object(evas, bg, 200, 160);
+ im = e_widget_image_add_from_object(evas, bg, pw, ph);
e_widget_image_object_set(im, e_thumb_evas_object_get(fullbg, evas, 200, 160, 1));
- }
+ }
free(noext);
i++;
}
if (im == NULL)
{
+ /* FIXME: this is broken as the edje extends outside at the start
+ * for some reason */
bg = edje_object_add(evas);
e_theme_edje_object_set(bg, "base/theme/background", "desktop/background");
- im = e_widget_image_add_from_object(evas, bg, 200, 160);
+ im = e_widget_image_add_from_object(evas, bg, pw, ph);
}
+
cfd->data = im;
}