options_themepv: add color scheme option

This commit is contained in:
Boris Faure 2020-10-20 22:35:02 +02:00
parent 16cdc7ae10
commit 0ea7705195
Signed by: borisfaure
GPG Key ID: 35C0410516166BE8
3 changed files with 22 additions and 14 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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