termio: set scale only when font/size is set

Should avoid error messages like
ERR<16582>:eina_safety ../src/lib/evas/canvas/evas_object_textgrid.c:1202
_evas_textgrid_efl_text_font_font_family_set() safety check failed:
(!font_name) || (!*font_name) is true
ERR<16582>:eina_safety ../src/lib/evas/canvas/evas_object_textgrid.c:1238
_evas_textgrid_efl_text_font_font_size_set() safety check failed:
font_size <= 0 is true
terminology-1.9
Boris Faure 2 years ago
parent 44952d9ac8
commit a617e9043b
Signed by: borisfaure
GPG Key ID: 35C0410516166BE8
  1. 2
      src/bin/options_themepv.c
  2. 4
      src/bin/termio.c

@ -293,7 +293,6 @@ options_theme_preview_add(Evas_Object *parent,
// create a texgrid and swallow pack into grid
o = evas_object_textgrid_add(evas);
colors_term_init(o, cs ? cs: config->color_scheme);
evas_object_scale_set(o, elm_config_scale_get());
if (config->font.bitmap)
{
char buf[PATH_MAX];
@ -304,6 +303,7 @@ options_theme_preview_add(Evas_Object *parent,
}
else
evas_object_textgrid_font_set(o, config->font.name, config->font.size);
evas_object_scale_set(o, elm_config_scale_get());
evas_object_textgrid_size_set(o, COLOR_MODE_PREVIEW_WIDTH,
COLOR_MODE_PREVIEW_HEIGHT);

@ -525,9 +525,9 @@ termio_config_update(Evas_Object *obj)
colors_term_init(sd->grid.obj, sd->config->color_scheme);
evas_object_scale_set(sd->grid.obj, elm_config_scale_get());
evas_object_textgrid_font_set(sd->grid.obj, sd->font.name, sd->font.size);
evas_object_textgrid_cell_size_get(sd->grid.obj, &w, &h);
evas_object_scale_set(sd->grid.obj, elm_config_scale_get());
if (w < 1) w = 1;
if (h < 1) h = 1;
@ -569,9 +569,9 @@ termio_config_set(Evas_Object *obj, Config *config)
sd->font.name = eina_stringshare_add(config->font.name);
sd->font.size = config->font.size;
evas_object_scale_set(sd->grid.obj, elm_config_scale_get());
evas_object_textgrid_font_set(sd->grid.obj, sd->font.name, sd->font.size);
evas_object_textgrid_size_get(sd->grid.obj, &w, &h);
evas_object_scale_set(sd->grid.obj, elm_config_scale_get());
if (w < 1) w = 1;
if (h < 1) h = 1;
evas_object_textgrid_size_set(sd->grid.obj, w, h);

Loading…
Cancel
Save