From 0ea7705195d8399161dd44a9e3946c296e7f0c1c Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Tue, 20 Oct 2020 22:35:02 +0200 Subject: [PATCH] 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 2fa02d4f..693ffd32 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 0b520cd0..6c23678e 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 fac2ea49..cff60085 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