aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/termcmd.c
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2015-08-06 21:26:43 +0200
committerBoris Faure <billiob@gmail.com>2015-08-06 21:53:14 +0200
commit3716c7ec51d25d93b70a5197bfbef4eb2f7b9e68 (patch)
tree55fc928df4423042fdb815a6e5ff8f37731ad688 /src/bin/termcmd.c
parentrewrite whether a term container is splittable. CID1315267 and CID1315268 (diff)
downloadterminology-3716c7ec51d25d93b70a5197bfbef4eb2f7b9e68.tar.gz
apply zoom level/font size to all terms in a window
Diffstat (limited to 'src/bin/termcmd.c')
-rw-r--r--src/bin/termcmd.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/bin/termcmd.c b/src/bin/termcmd.c
index cf5792f..cbe0073 100644
--- a/src/bin/termcmd.c
+++ b/src/bin/termcmd.c
@@ -23,12 +23,17 @@ _termcmd_search(Evas_Object *obj EINA_UNUSED, Evas_Object *win EINA_UNUSED, Evas
}
static Eina_Bool
-_termcmd_font_size(Evas_Object *obj, Evas_Object *win EINA_UNUSED, Evas_Object *bg EINA_UNUSED, const char *cmd)
+_termcmd_font_size(Evas_Object *obj, Evas_Object *win EINA_UNUSED,
+ Evas_Object *bg EINA_UNUSED, const char *cmd)
{
Config *config = termio_config_get(obj);
if (config)
{
+ Term *term = termio_term_get(obj);
+ Win *wn = term_win_get(term);
+ int new_size;
+
if (cmd[0] == 0) // back to default
{
config->font.bitmap = config->font.orig_bitmap;
@@ -37,8 +42,7 @@ _termcmd_font_size(Evas_Object *obj, Evas_Object *win EINA_UNUSED, Evas_Object *
eina_stringshare_del(config->font.name);
config->font.name = eina_stringshare_add(config->font.orig_name);
}
- termio_font_size_set(obj, config->font.orig_size);
- return EINA_TRUE;
+ new_size = config->font.orig_size;
}
else if (cmd[0] == 'b') // big font size
{
@@ -47,23 +51,24 @@ _termcmd_font_size(Evas_Object *obj, Evas_Object *win EINA_UNUSED, Evas_Object *
config->font.bitmap = 1;
eina_stringshare_del(config->font.name);
config->font.name = eina_stringshare_add("10x20.pcf");
- termio_font_size_set(obj, 20);
- }
- else
- {
- termio_font_size_set(obj, 20);
}
+ new_size = 20;
}
else if (cmd[0] == '+') // size up
{
- termio_font_size_set(obj, config->font.size + 1);
+ new_size = config->font.size + 1;
}
else if (cmd[0] == '-') // size down
{
- termio_font_size_set(obj, config->font.size - 1);
+ new_size = config->font.size - 1;
}
else
- ERR(_("Unknown font command: %s"), cmd);
+ {
+ ERR(_("Unknown font command: %s"), cmd);
+ return EINA_TRUE;
+ }
+
+ win_font_size_set(wn, new_size);
}
return EINA_TRUE;
}