aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/options_font.c
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2012-06-17 20:24:23 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2012-06-17 20:24:23 +0000
commit652df62d45e187b7b445e741c85c3458b367100d (patch)
tree809b78f370a7b4a9658d3a655615980dfc983c65 /src/bin/options_font.c
parentbetter handle -e 'command' if there is a shell expression. (diff)
downloadterminology-652df62d45e187b7b445e741c85c3458b367100d.tar.gz
options infrastructure refactor.
There is no global config option anymore, we have option instances that are set to the termio and media for future queries. The idea is that we can later have different configuration per termio, like multiple windows or tabs with different font size, background, etc. It's just a refactor. It would be better to define if things like background is up to the whole terminal and then save to a different config entry... or just save the global and copy it for next termio, defining the other instances as 'temporary'. Anyway: policy to be defined. SVN revision: 72315
Diffstat (limited to 'src/bin/options_font.c')
-rw-r--r--src/bin/options_font.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/bin/options_font.c b/src/bin/options_font.c
index 42f07c4..08b8f2f 100644
--- a/src/bin/options_font.c
+++ b/src/bin/options_font.c
@@ -41,25 +41,28 @@ static void
_cb_op_font_sel(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
{
Font *f = data;
+ Config *config = termio_config_get(f->term);
if ((config->font.name) && (!strcmp(f->name, config->font.name)))
return;
if (config->font.name) eina_stringshare_del(config->font.name);
config->font.name = eina_stringshare_add(f->name);
config->font.bitmap = f->bitmap;
_update_sizing(f->term);
- config_save();
+ config_save(config, NULL);
}
static void
_cb_op_fontsize_sel(void *data, Evas_Object *obj, void *event __UNUSED__)
{
- int size = elm_slider_value_get(obj) + 0.5;
+ Evas_Object *term = data;
+ Config *config = termio_config_get(term);
+ int size = elm_slider_value_get(obj) + 0.5;
if (config->font.size == size) return;
config->font.size = size;
- _update_sizing(data);
+ _update_sizing(term);
elm_genlist_realized_items_update(op_fontlist);
- config_save();
+ config_save(config, NULL);
}
static int
@@ -84,6 +87,7 @@ _cb_op_font_preview_eval(void *data, Evas *e __UNUSED__, Evas_Object *obj, void
Evas_Object *o;
Evas_Coord ox, oy, ow, oh, vx, vy, vw, vh;
char buf[4096];
+ Config *config = termio_config_get(f->term);
if (!evas_object_visible_get(obj)) return;
if (edje_object_part_swallow_get(obj, "terminology.content")) return;
@@ -116,13 +120,16 @@ static Evas_Object *
_cb_op_font_content_get(void *data, Evas_Object *obj, const char *part)
{
Font *f = data;
+ Config *config = termio_config_get(f->term);
+
if ((!strcmp(part, "elm.swallow.icon")) ||
(!strcmp(part, "elm.swallow.end")))
{
Evas_Object *o;
o = edje_object_add(evas_object_evas_get(obj));
- edje_object_file_set(o, config->theme, "terminology/fontpreview");
+ edje_object_file_set(o, config_theme_path_get(config),
+ "terminology/fontpreview");
evas_object_size_hint_min_set(o,
40 * elm_config_scale_get(),
40 * elm_config_scale_get());
@@ -186,6 +193,7 @@ options_font(Evas_Object *opbox, Evas_Object *term)
Font *f;
Elm_Object_Item *it, *sel_it = NULL, *grp_it = NULL;
Elm_Genlist_Item_Class *it_class, *it_group;
+ Config *config = termio_config_get(term);
options_font_clear();