aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/options_font.c
diff options
context:
space:
mode:
authorwonguk.jeong <wonguk.jeong@samsung.com>2014-06-24 21:39:19 +0200
committerBoris Faure <billiob@gmail.com>2014-06-24 21:39:19 +0200
commit69c8824caf1dd2db7364fd52946ccf721de5b077 (patch)
tree9b4a94d5fd7e460c9cc0ef068791481386bf9500 /src/bin/options_font.c
parentdo the fix correctly! (diff)
downloadterminology-69c8824caf1dd2db7364fd52946ccf721de5b077.tar.gz
option_font: selected standard font bug fix
Summary: Fallback of selected font finding logic is wrong. As Is: set selcted font if full name is exactly same or just font name without style is same To Be: find font which is exactly same full name. If failed to find, use find font with same font name Fixes https://phab.enlightenment.org/T1368 Test Plan: terminology -> set font in setting (as Dejavu Mono) -> open setting -> check whether font is Dejavu Mono or not Reviewers: billiob, raster Reviewed By: billiob CC: seoz Maniphest Tasks: https://phab.enlightenment.org/T1368 Differential Revision: https://phab.enlightenment.org/D1076
Diffstat (limited to 'src/bin/options_font.c')
-rw-r--r--src/bin/options_font.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/bin/options_font.c b/src/bin/options_font.c
index 98c15ff..c0797b7 100644
--- a/src/bin/options_font.c
+++ b/src/bin/options_font.c
@@ -340,7 +340,7 @@ options_font(Evas_Object *opbox, Evas_Object *term)
char buf[4096], *file, *fname;
Eina_List *files, *fontlist, *l;
Font *f;
- Elm_Object_Item *it, *sel_it = NULL, *grp_it = NULL;
+ Elm_Object_Item *it, *sel_it = NULL, *sel_it2 = NULL, *grp_it = NULL;
Elm_Genlist_Item_Class *it_class, *it_group;
Config *config = termio_config_get(term);
@@ -432,7 +432,7 @@ options_font(Evas_Object *opbox, Evas_Object *term)
f->item = it = elm_genlist_item_append(o, it_class, f, grp_it,
ELM_GENLIST_ITEM_NONE,
_cb_op_font_sel, f);
- if ((config->font.bitmap) && (config->font.name) &&
+ if ((!sel_it) && (config->font.bitmap) && (config->font.name) &&
((!strcmp(config->font.name, f->full_name)) ||
(!strcmp(config->font.name, file))))
{
@@ -474,23 +474,26 @@ options_font(Evas_Object *opbox, Evas_Object *term)
f->item = it = elm_genlist_item_append(o, it_class, f, grp_it,
ELM_GENLIST_ITEM_NONE,
_cb_op_font_sel, f);
- if ((!config->font.bitmap) && (config->font.name))
+ if ((!sel_it) && (!config->font.bitmap) && (config->font.name))
{
char *s = strchr(fname, ':');
size_t len;
len = (s == NULL) ? strlen(fname) : (size_t)(s - fname);
- if (!strcmp(config->font.name, f->full_name) ||
- !strncmp(config->font.name, fname, len))
- {
- sel_it = it;
- }
+ if (!strcmp(config->font.name, f->full_name))
+ sel_it = it;
+ else if ((!sel_it2) &&
+ (!strncmp(config->font.name, fname, len)))
+ sel_it2 = it;
}
}
}
+
if (fontlist)
evas_font_available_list_free(evas_object_evas_get(opbox), fontlist);
+ if (!sel_it && sel_it2)
+ sel_it = sel_it2;
if (sel_it)
{
elm_genlist_item_selected_set(sel_it, EINA_TRUE);