2 #include "e_int_config_theme.h"
3 #include "e_int_config_theme_web.h"
8 typedef struct _Web Web;
11 E_Config_Dialog *parent;
17 _web_pan_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
21 evas_object_smart_callback_call(obj, "changed", NULL);
22 evas_object_size_hint_min_get(obj, NULL, &th);
23 evas_object_geometry_get(obj, NULL, NULL, NULL, &vh);
26 if (y > th - vh) y = th - vh;
28 exchange_smart_object_offset_set(obj, 0, y);
32 _web_pan_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y)
36 exchange_smart_object_offset_get(obj, x, y);
40 _web_pan_max_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y)
42 Evas_Coord tw, th, vw, vh;
44 evas_object_size_hint_min_get(obj, &tw, &th);
45 evas_object_geometry_get(obj, NULL, NULL, &vw, &vh);
52 _web_pan_child_size_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y)
54 Evas_Coord tw, th, vw, vh;
56 evas_object_size_hint_min_get(obj, &tw, &th);
57 evas_object_geometry_get(obj, NULL, NULL, &vw, &vh);
64 e_int_config_theme_web_del(E_Dialog *dia)
69 e_int_config_theme_web_done(web->parent);
71 e_object_unref(E_OBJECT(dia));
75 _web_del_cb(void *obj)
79 e_int_config_theme_web_del(dia);
83 _web_close_cb(void *data, E_Dialog *dia)
85 e_int_config_theme_web_del(dia);
89 _web_apply(const char *path, void *data)
94 ct = e_theme_config_get("theme");
95 if ((ct) && (!strcmp(ct->file, path))) return;
97 e_theme_config_set("theme", path);
98 e_config_save_queue();
100 a = e_action_find("restart");
101 if ((a) && (a->func.go)) a->func.go(NULL, NULL);
107 e_int_config_theme_web(E_Config_Dialog *parent)
112 Evas_Object *ol, *exsm, *sf;
115 char usr_dir[PATH_MAX];
117 dia = e_dialog_new(parent->con, "E", "_theme_web_dialog");
118 if (!dia) return NULL;
121 if (!web) return NULL;
124 web->parent = parent;
126 e_dialog_title_set(dia, _("Exchange themes"));
127 e_dialog_border_icon_set(dia, "enlightenment/theme");
128 e_dialog_resizable_set(dia, 1);
129 e_dialog_button_add(dia, _("Close"), NULL, _web_close_cb, web);
132 e_object_del_attach_func_set(E_OBJECT(dia), _web_del_cb);
133 e_win_centered_set(dia->win, 1);
135 ol = e_widget_list_add(e_win_evas_get(dia->win), 0, 1);
137 // The Exchange Smart Object
138 e_user_dir_concat_static(usr_dir, "themes");
139 exsm = exchange_smart_object_add(e_win_evas_get(dia->win));
140 exchange_smart_object_remote_group_set(exsm, "Border");
141 exchange_smart_object_local_path_set(exsm, usr_dir);
142 exchange_smart_object_apply_cb_set(exsm, _web_apply, NULL);
145 sf = e_scrollframe_add(e_win_evas_get(dia->win));
146 e_scrollframe_extern_pan_set(sf, exsm, _web_pan_set, _web_pan_get,
147 _web_pan_max_get, _web_pan_child_size_get);
148 e_scrollframe_policy_set(sf, E_SCROLLFRAME_POLICY_OFF,
149 E_SCROLLFRAME_POLICY_ON);
150 e_scrollframe_thumbscroll_force(sf, 1);
152 e_widget_list_object_append(ol, sf, 1, 1, 0.5);
153 e_dialog_content_set(dia, ol, 500, 400);
156 exchange_smart_object_run(exsm);