2006-10-02 22:49:31 -07:00
|
|
|
#include "e.h"
|
2015-04-21 12:31:04 -07:00
|
|
|
#define EFL_BETA_API_SUPPORT
|
|
|
|
#include <elm_color_class.h>
|
2006-10-02 22:49:31 -07:00
|
|
|
|
2015-04-06 11:38:43 -07:00
|
|
|
static char *
|
|
|
|
_translate(char *str)
|
2010-03-06 21:33:34 -08:00
|
|
|
{
|
2015-04-06 11:38:43 -07:00
|
|
|
return _(str);
|
2006-10-02 22:49:31 -07:00
|
|
|
}
|
|
|
|
|
2015-04-06 11:38:43 -07:00
|
|
|
static Eina_List *
|
|
|
|
_list(void)
|
2006-10-02 22:49:31 -07:00
|
|
|
{
|
2015-04-06 11:38:43 -07:00
|
|
|
Eina_List *l, *ret = NULL;
|
|
|
|
Eina_Iterator *it;
|
|
|
|
Eina_File *f;
|
2006-10-10 03:40:56 -07:00
|
|
|
|
2015-04-06 11:38:43 -07:00
|
|
|
it = edje_file_iterator_new();
|
|
|
|
if (!it) return NULL;
|
|
|
|
EINA_ITERATOR_FOREACH(it, f)
|
2010-03-06 21:33:34 -08:00
|
|
|
{
|
2015-04-06 11:38:43 -07:00
|
|
|
l = elm_color_class_util_edje_file_list(f);
|
|
|
|
if (l)
|
|
|
|
ret = eina_list_merge(ret, l);
|
2010-03-06 21:33:34 -08:00
|
|
|
}
|
2015-04-06 11:38:43 -07:00
|
|
|
eina_iterator_free(it);
|
2010-03-06 21:33:34 -08:00
|
|
|
return ret;
|
2008-12-31 18:08:06 -08:00
|
|
|
}
|
|
|
|
|
2006-10-02 22:49:31 -07:00
|
|
|
static Evas_Object *
|
2015-04-06 11:38:43 -07:00
|
|
|
_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas EINA_UNUSED, E_Config_Dialog_Data *cfdata EINA_UNUSED)
|
2006-10-02 22:49:31 -07:00
|
|
|
{
|
2015-04-06 11:38:43 -07:00
|
|
|
Evas_Object *o;
|
2010-03-06 21:33:34 -08:00
|
|
|
|
2014-12-22 06:02:05 -08:00
|
|
|
e_dialog_resizable_set(cfd->dia, 1);
|
2015-04-06 11:38:43 -07:00
|
|
|
o = elm_color_class_editor_add(cfd->dia->win, 0);
|
|
|
|
evas_object_size_hint_min_set(o, 400, 280);
|
2010-03-04 13:58:23 -08:00
|
|
|
|
2010-03-06 21:33:34 -08:00
|
|
|
e_util_win_auto_resize_fill(cfd->dia->win);
|
2014-11-02 18:35:13 -08:00
|
|
|
elm_win_center(cfd->dia->win, 1, 1);
|
2010-03-06 21:33:34 -08:00
|
|
|
|
2015-04-06 11:38:43 -07:00
|
|
|
return o;
|
2006-10-03 07:14:59 -07:00
|
|
|
}
|
2006-10-03 10:17:04 -07:00
|
|
|
|
2015-04-06 11:38:43 -07:00
|
|
|
E_Config_Dialog *
|
|
|
|
e_int_config_color_classes(Evas_Object *parent EINA_UNUSED, const char *params EINA_UNUSED)
|
2006-10-10 21:51:30 -07:00
|
|
|
{
|
2015-04-06 11:38:43 -07:00
|
|
|
E_Config_Dialog *cfd;
|
|
|
|
E_Config_Dialog_View *v;
|
2010-03-06 21:33:34 -08:00
|
|
|
|
2015-04-06 11:38:43 -07:00
|
|
|
if (e_config_dialog_find("E", "appearance/colors")) return NULL;
|
|
|
|
v = E_NEW(E_Config_Dialog_View, 1);
|
|
|
|
if (!v) return NULL;
|
2012-07-02 01:09:17 -07:00
|
|
|
|
2015-04-06 11:38:43 -07:00
|
|
|
v->basic.create_widgets = _basic_create_widgets;
|
2012-07-02 01:09:17 -07:00
|
|
|
|
2015-04-06 11:38:43 -07:00
|
|
|
elm_color_class_translate_cb_set(_translate);
|
|
|
|
elm_color_class_list_cb_set(_list);
|
2010-03-06 21:33:34 -08:00
|
|
|
|
2015-04-06 11:38:43 -07:00
|
|
|
cfd = e_config_dialog_new(NULL, _("Colors"), "E", "appearance/colors",
|
|
|
|
"preferences-desktop-color", 0, v, NULL);
|
|
|
|
return cfd;
|
2010-03-06 21:33:34 -08:00
|
|
|
}
|