aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/options_font.c
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2012-06-19 15:59:49 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2012-06-19 15:59:49 +0000
commit2cd2514538d5b59c4398de4974d8bf530ebc2a85 (patch)
tree54902456f373fe71fc32fc6e747bbbed805ac134 /src/bin/options_font.c
parentemit key sig all the time. (diff)
downloadterminology-2cd2514538d5b59c4398de4974d8bf530ebc2a85.tar.gz
utils/theme: unify code, error messages and allow fallback.
Introduced two nice helpers to aid common Edje handling: * apply theme, using fallback if main is not found; * reload theme if file changed. SVN revision: 72490
Diffstat (limited to 'src/bin/options_font.c')
-rw-r--r--src/bin/options_font.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/src/bin/options_font.c b/src/bin/options_font.c
index ce90dea..3d6ce6b 100644
--- a/src/bin/options_font.c
+++ b/src/bin/options_font.c
@@ -5,6 +5,7 @@
#include "termio.h"
#include "options.h"
#include "options_font.h"
+#include "utils.h"
static Evas_Object *op_fontslider, *op_fontlist, *op_fsml, *op_fbig;
@@ -22,18 +23,6 @@ static Eina_List *fonts = NULL;
static Eina_Hash *fonthash = NULL;
static void
-_reload_theme(void *data __UNUSED__, Evas_Object *obj,
- const char *emission __UNUSED__, const char *source __UNUSED__)
-{
- const char *file;
- const char *group;
-
- edje_object_file_get(obj, &file, &group);
- edje_object_file_set(obj, file, group);
- fprintf(stderr, "RELOADING THEME\n");
-}
-
-static void
_update_sizing(Evas_Object *term)
{
Evas_Coord ow = 0, oh = 0, mw = 1, mh = 1, w, h;
@@ -140,10 +129,8 @@ _cb_op_font_content_get(void *data, Evas_Object *obj, const char *part)
Config *config = termio_config_get(f->term);
o = edje_object_add(evas_object_evas_get(obj));
- edje_object_file_set(o, config_theme_path_get(config),
- "terminology/fontpreview");
- edje_object_signal_callback_add(o, "edje,change,file", "edje",
- _reload_theme, NULL);
+ theme_apply(o, config, "terminology/fontpreview");
+ theme_auto_reload_enable(o);
evas_object_size_hint_min_set(o,
96 * elm_config_scale_get(),
40 * elm_config_scale_get());