summaryrefslogtreecommitdiff
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
parentcf7ea0ea50bfb0cb8ae477e0646306106d826785 (diff)
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 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: 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)
340 char buf[4096], *file, *fname; 340 char buf[4096], *file, *fname;
341 Eina_List *files, *fontlist, *l; 341 Eina_List *files, *fontlist, *l;
342 Font *f; 342 Font *f;
343 Elm_Object_Item *it, *sel_it = NULL, *grp_it = NULL; 343 Elm_Object_Item *it, *sel_it = NULL, *sel_it2 = NULL, *grp_it = NULL;
344 Elm_Genlist_Item_Class *it_class, *it_group; 344 Elm_Genlist_Item_Class *it_class, *it_group;
345 Config *config = termio_config_get(term); 345 Config *config = termio_config_get(term);
346 346
@@ -432,7 +432,7 @@ options_font(Evas_Object *opbox, Evas_Object *term)
432 f->item = it = elm_genlist_item_append(o, it_class, f, grp_it, 432 f->item = it = elm_genlist_item_append(o, it_class, f, grp_it,
433 ELM_GENLIST_ITEM_NONE, 433 ELM_GENLIST_ITEM_NONE,
434 _cb_op_font_sel, f); 434 _cb_op_font_sel, f);
435 if ((config->font.bitmap) && (config->font.name) && 435 if ((!sel_it) && (config->font.bitmap) && (config->font.name) &&
436 ((!strcmp(config->font.name, f->full_name)) || 436 ((!strcmp(config->font.name, f->full_name)) ||
437 (!strcmp(config->font.name, file)))) 437 (!strcmp(config->font.name, file))))
438 { 438 {
@@ -474,23 +474,26 @@ options_font(Evas_Object *opbox, Evas_Object *term)
474 f->item = it = elm_genlist_item_append(o, it_class, f, grp_it, 474 f->item = it = elm_genlist_item_append(o, it_class, f, grp_it,
475 ELM_GENLIST_ITEM_NONE, 475 ELM_GENLIST_ITEM_NONE,
476 _cb_op_font_sel, f); 476 _cb_op_font_sel, f);
477 if ((!config->font.bitmap) && (config->font.name)) 477 if ((!sel_it) && (!config->font.bitmap) && (config->font.name))
478 { 478 {
479 char *s = strchr(fname, ':'); 479 char *s = strchr(fname, ':');
480 size_t len; 480 size_t len;
481 481
482 len = (s == NULL) ? strlen(fname) : (size_t)(s - fname); 482 len = (s == NULL) ? strlen(fname) : (size_t)(s - fname);
483 if (!strcmp(config->font.name, f->full_name) || 483 if (!strcmp(config->font.name, f->full_name))
484 !strncmp(config->font.name, fname, len)) 484 sel_it = it;
485 { 485 else if ((!sel_it2) &&
486 sel_it = it; 486 (!strncmp(config->font.name, fname, len)))
487 } 487 sel_it2 = it;
488 } 488 }
489 } 489 }
490 } 490 }
491
491 if (fontlist) 492 if (fontlist)
492 evas_font_available_list_free(evas_object_evas_get(opbox), fontlist); 493 evas_font_available_list_free(evas_object_evas_get(opbox), fontlist);
493 494
495 if (!sel_it && sel_it2)
496 sel_it = sel_it2;
494 if (sel_it) 497 if (sel_it)
495 { 498 {
496 elm_genlist_item_selected_set(sel_it, EINA_TRUE); 499 elm_genlist_item_selected_set(sel_it, EINA_TRUE);