billiob pushed a commit to branch master. http://git.enlightenment.org/apps/terminology.git/commit/?id=0ea7705195d8399161dd44a9e3946c296e7f0c1c
commit 0ea7705195d8399161dd44a9e3946c296e7f0c1c Author: Boris Faure <bill...@gmail.com> Date: Tue Oct 20 22:35:02 2020 +0200 options_themepv: add color scheme option --- src/bin/options_theme.c | 1 + src/bin/options_themepv.c | 26 +++++++++++++------------- src/bin/options_themepv.h | 9 ++++++++- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/src/bin/options_theme.c b/src/bin/options_theme.c index 2fa02d4..693ffd3 100644 --- a/src/bin/options_theme.c +++ b/src/bin/options_theme.c @@ -59,6 +59,7 @@ _cb_op_theme_content_get(void *data, Evas_Object *obj, const char *part) o = options_theme_preview_add(obj, config, theme_path_get(t->name), + NULL, 128 * elm_config_scale_get(), 64 * elm_config_scale_get()); return o; diff --git a/src/bin/options_themepv.c b/src/bin/options_themepv.c index 0b520cd..6c23678 100644 --- a/src/bin/options_themepv.c +++ b/src/bin/options_themepv.c @@ -95,8 +95,10 @@ _cb_resize(void *_data EINA_UNUSED, Evas_Object * options_theme_preview_add(Evas_Object *parent, - Config *config, - const char *file, Evas_Coord w, Evas_Coord h) + const Config *config, + const char *file, + const Color_Scheme *cs, + Evas_Coord w, Evas_Coord h) { Evas_Object *o, *oo, *obase, *oe, *obg; Evas *evas; @@ -111,7 +113,7 @@ options_theme_preview_add(Evas_Object *parent, oe = elm_layout_edje_get(o); obg = oe; theme_apply(oe, config, "terminology/background", - file, NULL, EINA_FALSE); + file, cs, EINA_FALSE); if (config->translucent) edje_object_signal_emit(oe, "translucent,on", "terminology"); else @@ -133,7 +135,7 @@ options_theme_preview_add(Evas_Object *parent, o = elm_layout_add(parent); oe = elm_layout_edje_get(o); theme_apply(oe, config, "terminology/core", - file, NULL, EINA_FALSE); + file, cs, EINA_FALSE); if (config->translucent) edje_object_signal_emit(oe, "translucent,on", "terminology"); else @@ -207,21 +209,19 @@ options_theme_preview_add(Evas_Object *parent, // create a cursor and put it in the grid o = elm_layout_add(parent); - oe = elm_layout_edje_get(o); - theme_apply(oe, config, "terminology/cursor", - file, NULL, EINA_FALSE); - edje_object_signal_emit(oe, "focus,in", "terminology"); + theme_apply(o, config, "terminology/cursor", + file, cs, EINA_TRUE); + elm_layout_signal_emit(o, "focus,in", "terminology"); evas_object_show(o); evas_object_data_set(oo, "cursor", o); elm_grid_pack(oo, o, 0, 0, 10, 10); // create a selection and put it in the grid o = edje_object_add(evas); - oe = o; - theme_apply(oe, config, "terminology/selection", - file, NULL, EINA_FALSE); - edje_object_signal_emit(oe, "focus,in", "terminology"); - edje_object_signal_emit(oe, "mode,oneline", "terminology"); + theme_apply(o, config, "terminology/selection", + file, cs, EINA_FALSE); + edje_object_signal_emit(o, "focus,in", "terminology"); + edje_object_signal_emit(o, "mode,oneline", "terminology"); evas_object_show(o); evas_object_data_set(oo, "selection", o); elm_grid_pack(oo, o, 0, 0, 10, 10); diff --git a/src/bin/options_themepv.h b/src/bin/options_themepv.h index fac2ea4..cff6008 100644 --- a/src/bin/options_themepv.h +++ b/src/bin/options_themepv.h @@ -1,6 +1,13 @@ #ifndef _OPTIONS_THEMEPV_H__ #define _OPTIONS_THEMEPV_H__ 1 +#include "colors.h" -Evas_Object *options_theme_preview_add(Evas_Object *parent, Config *config, const char *file, Evas_Coord w, Evas_Coord h); +Evas_Object * +options_theme_preview_add(Evas_Object *parent, + const Config *config, + const char *file, + const Color_Scheme *cs, + Evas_Coord w, + Evas_Coord h); #endif --