Compare commits

...

2 Commits

Author SHA1 Message Date
Mike Blumenkrantz 369977cb18 add colorclass editor to settings panel 7 years ago
Mike Blumenkrantz d470649e9b set colorclass descriptions for default color classes 7 years ago
  1. 138
      data/themes/default_colors.in.edc
  2. 45
      src/bin/main.c
  3. 9
      src/bin/options.c
  4. 22
      src/bin/options_colors.c
  5. 3
      src/bin/options_colors.h

@ -1,72 +1,72 @@
color_class { name: "c0"; color: 170 170 170 255; } // COL_DEF
color_class { name: "c1"; color: 0 0 0 255; } // COL_BLACK
color_class { name: "c2"; color: 204 51 51 255; } // COL_RED
color_class { name: "c3"; color: 51 204 51 255; } // COL_GREEN
color_class { name: "c4"; color: 204 136 51 255; } // COL_YELLOW
color_class { name: "c5"; color: 51 51 204 255; } // COL_BLUE
color_class { name: "c6"; color: 204 51 204 255; } // COL_MAGENTA
color_class { name: "c7"; color: 51 204 204 255; } // COL_CYAN
color_class { name: "c8"; color: 204 204 204 255; } // COL_WHITE
color_class { name: "c9"; color: 0 0 0 0; } // COL_INVIS
color_class { name: "c10"; color: 34 34 34 255; } // COL_INVERSE
color_class { name: "c11"; color: 170 170 170 255; } // COL_INVERSEBG
color_class { name: "c12"; color: 238 238 238 255; } // COL_DEF
color_class { name: "c13"; color: 102 102 102 255; } // COL_BLACK
color_class { name: "c14"; color: 255 102 102 255; } // COL_RED
color_class { name: "c15"; color: 102 255 102 255; } // COL_GREEN
color_class { name: "c16"; color: 255 255 102 255; } // COL_YELLOW
color_class { name: "c17"; color: 102 102 255 255; } // COL_BLUE
color_class { name: "c18"; color: 255 102 255 255; } // COL_MAGENTA
color_class { name: "c19"; color: 102 255 255 255; } // COL_CYAN
color_class { name: "c20"; color: 255 255 255 255; } // COL_WHITE
color_class { name: "c21"; color: 0 0 0 0; } // COL_INVIS
color_class { name: "c22"; color: 17 17 17 255; } // COL_INVERSE
color_class { name: "c23"; color: 238 238 238 255; } // COL_INVERSEBG
color_class { name: "c24"; color: 221 221 221 255; } // COL_DEF
color_class { name: "c25"; color: 0 0 0 255; } // COL_BLACK
color_class { name: "c26"; color: 204 136 136 255; } // COL_RED
color_class { name: "c27"; color: 136 204 136 255; } // COL_GREEN
color_class { name: "c28"; color: 204 170 136 255; } // COL_YELLOW
color_class { name: "c29"; color: 136 136 204 255; } // COL_BLUE
color_class { name: "c30"; color: 204 136 204 255; } // COL_MAGENTA
color_class { name: "c31"; color: 136 204 204 255; } // COL_CYAN
color_class { name: "c32"; color: 204 204 204 255; } // COL_WHITE
color_class { name: "c33"; color: 0 0 0 0; } // COL_INVIS
color_class { name: "c34"; color: 17 17 17 255; } // COL_INVERSE
color_class { name: "c35"; color: 204 204 204 255; } // COL_INVERSEBG
color_class { name: "c36"; color: 255 255 255 255; } // COL_DEF
color_class { name: "c37"; color: 204 204 204 255; } // COL_BLACK
color_class { name: "c38"; color: 255 204 204 255; } // COL_RED
color_class { name: "c39"; color: 204 255 204 255; } // COL_GREEN
color_class { name: "c40"; color: 255 255 204 255; } // COL_YELLOW
color_class { name: "c41"; color: 204 204 255 255; } // COL_BLUE
color_class { name: "c42"; color: 255 204 255 255; } // COL_MAGENTA
color_class { name: "c43"; color: 204 255 255 255; } // COL_CYAN
color_class { name: "c44"; color: 255 255 255 255; } // COL_WHITE
color_class { name: "c45"; color: 0 0 0 0; } // COL_INVIS
color_class { name: "c46"; color: 0 0 0 255; } // COL_INVERSE
color_class { name: "c47"; color: 255 255 255 255; } // COL_INVERSEBG
color_class { name: "C0"; color: 0 0 0 255; } // COL_BLACK
color_class { name: "C1"; color: 204 51 51 255; } // COL_RED
color_class { name: "C2"; color: 51 204 51 255; } // COL_GREEN
color_class { name: "C3"; color: 204 136 51 255; } // COL_YELLOW
color_class { name: "C4"; color: 51 51 204 255; } // COL_BLUE
color_class { name: "C5"; color: 204 51 204 255; } // COL_MAGENTA
color_class { name: "C6"; color: 51 204 204 255; } // COL_CYAN
color_class { name: "C7"; color: 204 204 204 255; } // COL_WHITE
color_class { name: "C8"; color: 102 102 102 255; } // COL_BLACK
color_class { name: "C9"; color: 255 102 102 255; } // COL_RED
color_class { name: "C10"; color: 102 255 102 255; } // COL_GREEN
color_class { name: "C11"; color: 255 255 102 255; } // COL_YELLOW
color_class { name: "C12"; color: 102 102 255 255; } // COL_BLUE
color_class { name: "C13"; color: 255 102 255 255; } // COL_MAGENTA
color_class { name: "C14"; color: 102 255 255 255; } // COL_CYAN
color_class { name: "C15"; color: 255 255 255 255; } // COL_WHITE
color_class { name: "c0"; color: 170 170 170 255; description: "COL_DEF"; }
color_class { name: "c1"; color: 0 0 0 255; description: "COL_BLACK"; }
color_class { name: "c2"; color: 204 51 51 255; description: "COL_RED"; }
color_class { name: "c3"; color: 51 204 51 255; description: "COL_GREEN"; }
color_class { name: "c4"; color: 204 136 51 255; description: "COL_YELLOW"; }
color_class { name: "c5"; color: 51 51 204 255; description: "COL_BLUE"; }
color_class { name: "c6"; color: 204 51 204 255; description: "COL_MAGENTA"; }
color_class { name: "c7"; color: 51 204 204 255; description: "COL_CYAN"; }
color_class { name: "c8"; color: 204 204 204 255; description: "COL_WHITE"; }
color_class { name: "c9"; color: 0 0 0 0; description: "COL_INVIS"; }
color_class { name: "c10"; color: 34 34 34 255; description: "COL_INVERSE"; }
color_class { name: "c11"; color: 170 170 170 255; description: "COL_INVERSEBG"; }
color_class { name: "c12"; color: 238 238 238 255; description: "COL_DEF"; }
color_class { name: "c13"; color: 102 102 102 255; description: "COL_BLACK"; }
color_class { name: "c14"; color: 255 102 102 255; description: "COL_RED"; }
color_class { name: "c15"; color: 102 255 102 255; description: "COL_GREEN"; }
color_class { name: "c16"; color: 255 255 102 255; description: "COL_YELLOW"; }
color_class { name: "c17"; color: 102 102 255 255; description: "COL_BLUE"; }
color_class { name: "c18"; color: 255 102 255 255; description: "COL_MAGENTA"; }
color_class { name: "c19"; color: 102 255 255 255; description: "COL_CYAN"; }
color_class { name: "c20"; color: 255 255 255 255; description: "COL_WHITE"; }
color_class { name: "c21"; color: 0 0 0 0; description: "COL_INVIS"; }
color_class { name: "c22"; color: 17 17 17 255; description: "COL_INVERSE"; }
color_class { name: "c23"; color: 238 238 238 255; description: "COL_INVERSEBG"; }
color_class { name: "c24"; color: 221 221 221 255; description: "COL_DEF"; }
color_class { name: "c25"; color: 0 0 0 255; description: "COL_BLACK"; }
color_class { name: "c26"; color: 204 136 136 255; description: "COL_RED"; }
color_class { name: "c27"; color: 136 204 136 255; description: "COL_GREEN"; }
color_class { name: "c28"; color: 204 170 136 255; description: "COL_YELLOW"; }
color_class { name: "c29"; color: 136 136 204 255; description: "COL_BLUE"; }
color_class { name: "c30"; color: 204 136 204 255; description: "COL_MAGENTA"; }
color_class { name: "c31"; color: 136 204 204 255; description: "COL_CYAN"; }
color_class { name: "c32"; color: 204 204 204 255; description: "COL_WHITE"; }
color_class { name: "c33"; color: 0 0 0 0; description: "COL_INVIS"; }
color_class { name: "c34"; color: 17 17 17 255; description: "COL_INVERSE"; }
color_class { name: "c35"; color: 204 204 204 255; description: "COL_INVERSEBG"; }
color_class { name: "c36"; color: 255 255 255 255; description: "COL_DEF"; }
color_class { name: "c37"; color: 204 204 204 255; description: "COL_BLACK"; }
color_class { name: "c38"; color: 255 204 204 255; description: "COL_RED"; }
color_class { name: "c39"; color: 204 255 204 255; description: "COL_GREEN"; }
color_class { name: "c40"; color: 255 255 204 255; description: "COL_YELLOW"; }
color_class { name: "c41"; color: 204 204 255 255; description: "COL_BLUE"; }
color_class { name: "c42"; color: 255 204 255 255; description: "COL_MAGENTA"; }
color_class { name: "c43"; color: 204 255 255 255; description: "COL_CYAN"; }
color_class { name: "c44"; color: 255 255 255 255; description: "COL_WHITE"; }
color_class { name: "c45"; color: 0 0 0 0; description: "COL_INVIS"; }
color_class { name: "c46"; color: 0 0 0 255; description: "COL_INVERSE"; }
color_class { name: "c47"; color: 255 255 255 255; description: "COL_INVERSEBG"; }
color_class { name: "C0"; color: 0 0 0 255; description: "COL_BLACK"; }
color_class { name: "C1"; color: 204 51 51 255; description: "COL_RED"; }
color_class { name: "C2"; color: 51 204 51 255; description: "COL_GREEN"; }
color_class { name: "C3"; color: 204 136 51 255; description: "COL_YELLOW"; }
color_class { name: "C4"; color: 51 51 204 255; description: "COL_BLUE"; }
color_class { name: "C5"; color: 204 51 204 255; description: "COL_MAGENTA"; }
color_class { name: "C6"; color: 51 204 204 255; description: "COL_CYAN"; }
color_class { name: "C7"; color: 204 204 204 255; description: "COL_WHITE"; }
color_class { name: "C8"; color: 102 102 102 255; description: "COL_BLACK"; }
color_class { name: "C9"; color: 255 102 102 255; description: "COL_RED"; }
color_class { name: "C10"; color: 102 255 102 255; description: "COL_GREEN"; }
color_class { name: "C11"; color: 255 255 102 255; description: "COL_YELLOW"; }
color_class { name: "C12"; color: 102 102 255 255; description: "COL_BLUE"; }
color_class { name: "C13"; color: 255 102 255 255; description: "COL_MAGENTA"; }
color_class { name: "C14"; color: 102 255 255 255; description: "COL_CYAN"; }
color_class { name: "C15"; color: 255 255 255 255; description: "COL_WHITE"; }
#if 0 // disabled, use defaults.
// pure 6x6x6 colorcube

@ -440,6 +440,44 @@ _translate_options(void)
}
#endif
#ifdef ELM_COLOR_CLASS_H
# if defined(HAVE_GETTEXT) && defined(ENABLE_NLS)
static char *
colorclasses_name_cb(char *name)
{
return _(name);
}
#endif
static Eina_List *
colorclasses_list_cb(void)
{
Eina_List *l, *ret = NULL;
Eina_Iterator *it;
Eina_File *f;
const char *config_dir = efreet_config_home_get(),
*data_dir = elm_app_data_dir_get();
char buf[PATH_MAX], buf2[PATH_MAX];
it = edje_file_iterator_new();
if (!it) return NULL;
snprintf(buf, sizeof(buf), "%s/themes", data_dir);
snprintf(buf2, sizeof(buf2), "%s/terminology/themes", config_dir);
EINA_ITERATOR_FOREACH(it, f)
{
const char *name;
name = eina_file_filename_get(f);
if ((!strstr(name, buf)) && (!strstr(name, buf2))) continue;
l = elm_color_class_util_edje_file_list(f);
if (l)
ret = eina_list_merge(ret, l);
}
eina_iterator_free(it);
return ret;
}
#endif
EAPI_MAIN int
elm_main(int argc, char **argv)
{
@ -540,6 +578,9 @@ elm_main(int argc, char **argv)
bindtextdomain(PACKAGE, elm_app_locale_dir_get());
textdomain(PACKAGE);
_translate_options();
# ifdef ELM_COLOR_CLASS_H
elm_color_class_translate_cb_set(colorclasses_name_cb);
# endif
#else
options.copyright = "(C) 2012-2015 Carsten Haitzler and others";
#endif
@ -575,7 +616,9 @@ elm_main(int argc, char **argv)
}
if (quit_option) goto end;
#ifdef ELM_COLOR_CLASS_H
elm_color_class_list_cb_set(colorclasses_list_cb);
#endif
#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
if (cmd_options)
{

@ -30,6 +30,9 @@ static enum option_mode {
OPTION_THEME,
OPTION_WALLPAPER,
OPTION_COLORS,
#ifdef ELM_COLOR_CLASS_H
OPTION_COLORCLASSES,
#endif
OPTION_VIDEO,
OPTION_BEHAVIOR,
OPTION_KEYS,
@ -86,6 +89,9 @@ _cb_opdt_hide_done(void *data, Evas_Object *obj EINA_UNUSED, const char *sig EIN
case OPTION_THEME: options_theme(op_opbox, data); break;
case OPTION_WALLPAPER: options_wallpaper(op_opbox, data); break;
case OPTION_COLORS: options_colors(op_opbox, data); break;
#ifdef ELM_COLOR_CLASS_H
case OPTION_COLORCLASSES: options_colorclasses(op_opbox, data); break;
#endif
case OPTION_VIDEO: options_video(op_opbox, data); break;
case OPTION_BEHAVIOR: options_behavior(op_opbox, data); break;
case OPTION_KEYS: options_keys(op_opbox, data); break;
@ -168,6 +174,9 @@ options_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term,
ITEM_APPEND("preferences-desktop-wallpaper", _("Wallpaper"), WALLPAPER);
ITEM_APPEND("video-display", _("Video"), VIDEO);
ITEM_APPEND("preferences-desktop-theme", _("Colors"), COLORS);
#ifdef ELM_COLOR_CLASS_H
ITEM_APPEND("preferences-desktop-theme", _("Color Classes"), COLORCLASSES);
#endif
ITEM_APPEND("preferences-system", _("Behavior"), BEHAVIOR);
ITEM_APPEND("preferences-desktop-keyboard-shortcuts", _("Keys"), KEYS);
ITEM_APPEND("system-run", _("Helpers"), HELPERS);

@ -287,3 +287,25 @@ options_colors(Evas_Object *opbox, Evas_Object *term)
evas_object_show(o);
evas_object_smart_callback_add(o, "clicked", _cb_op_reset, term);
}
#ifdef ELM_COLOR_CLASS_H
void
options_colorclasses(Evas_Object *opbox, Evas_Object *term EINA_UNUSED)
{
Evas_Object *o, *fr;
fr = o = elm_frame_add(opbox);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_object_text_set(o, _("Color Classes"));
elm_box_pack_end(opbox, o);
evas_object_show(o);
o = elm_color_class_editor_add(opbox, 0);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_object_text_set(o, _("Color Classes"));
elm_object_content_set(fr, o);
evas_object_show(o);
}
#endif

@ -2,5 +2,8 @@
#define _OPTIONS_COLORS_H__ 1
void options_colors(Evas_Object *opbox, Evas_Object *term);
#ifdef ELM_COLOR_CLASS_H
void options_colorclasses(Evas_Object *opbox, Evas_Object *term);
#endif
#endif

Loading…
Cancel
Save