Enlightenment CVS committal Author : sndev Project : e_modules Module : language
Dir : e_modules/language/src/module Modified Files: e_mod_config.c e_mod_main.c Log Message: * Adding flag images. * todo -- =================================================================== RCS file: /cvs/e/e_modules/language/src/module/e_mod_config.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- e_mod_config.c 27 May 2006 22:05:08 -0000 1.14 +++ e_mod_config.c 29 May 2006 21:09:44 -0000 1.15 @@ -357,6 +357,7 @@ { //FIXME: optimize - too slow char buf[1024]; + char lbuf[1024]; Evas_List *l, *l2; Language_Predef *lp; Language *lang; @@ -395,8 +396,10 @@ snprintf(buf, sizeof(buf), ILIST_LANGUAGE_LABEL_FORMAT, lp->lang_name, lp->lang_shortcut); - ic = edje_object_add(cfdata->evas); - e_util_edje_icon_set(ic, "enlightenment/e"); + ic = e_icon_add(cfdata->evas); + snprintf(lbuf, sizeof(lbuf), "%s/images/%s.png", e_module_dir_get(cfdata->conf->module), + lp->lang_flag); + e_icon_file_set(ic, lbuf); e_widget_ilist_append(cfdata->gui.lang_ilist, ic, buf, NULL, NULL, NULL); } @@ -423,6 +426,7 @@ { //FIXME: optimize - too slow char buf[1024]; + char lbuf[1024]; Evas_List *l; Language *lang; int indx; @@ -443,8 +447,10 @@ snprintf(buf, sizeof(buf), ILIST_LANGUAGE_LABEL_FORMAT, lang->lang_name, lang->lang_shortcut); - ic = edje_object_add(cfdata->evas); - e_util_edje_icon_set(ic, "enlightenment/e"); + ic = e_icon_add(cfdata->evas); + snprintf(lbuf, sizeof(lbuf), "%s/images/%s.png", e_module_dir_get(cfdata->conf->module), + lang->lang_flag); + e_icon_file_set(ic, lbuf); e_widget_ilist_append(cfdata->gui.selected_lang_ilist, ic, buf, NULL, NULL, NULL); } =================================================================== RCS file: /cvs/e/e_modules/language/src/module/e_mod_main.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- e_mod_main.c 27 May 2006 22:05:08 -0000 1.14 +++ e_mod_main.c 29 May 2006 21:09:44 -0000 1.15 @@ -48,6 +48,7 @@ { E_Gadcon_Client *gcc; Evas_Object *o_language; + Evas_Object *o_flag; }; static E_Gadcon_Client * @@ -73,6 +74,12 @@ inst->gcc = gcc; inst->o_language = o; + inst->o_flag = e_icon_add(gc->evas); + snprintf(buf, sizeof(buf), "%s/images/unknown_flag.png", + e_module_dir_get(language_config->module)); + e_icon_file_set(inst->o_flag, buf); + edje_object_part_swallow(inst->o_language, "language_flag", inst->o_flag); + evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, _lang_button_cb_mouse_down, inst); @@ -88,6 +95,7 @@ inst = gcc->data; language_config->instances = evas_list_remove(language_config->instances, inst); evas_object_del(inst->o_language); + evas_object_del(inst->o_flag); free(inst); } static void @@ -96,8 +104,8 @@ Instance *inst; inst = gcc->data; - e_gadcon_client_aspect_set(gcc, 16, 16); - e_gadcon_client_min_size_set(gcc, 16, 16); + e_gadcon_client_aspect_set(gcc, 24, 16); + e_gadcon_client_min_size_set(gcc, 24, 16); } static char * _gc_label(void) @@ -142,9 +150,6 @@ E_CONFIG_VAL(D, T, rdefs.model, STR); E_CONFIG_VAL(D, T, rdefs.layout, STR); E_CONFIG_VAL(D, T, rdefs.variant, STR); - /*E_CONFIG_VAL(D, T, kbd_model, STR); - E_CONFIG_VAL(D, T, kbd_layout, STR); - E_CONFIG_VAL(D, T, kbd_variant, STR);*/ conf_edd = E_CONFIG_DD_NEW("Language_Config", Config); #undef T @@ -309,6 +314,7 @@ Evas_List *l; Instance *inst; static int counter = 0; + char lbuf[4096]; if (!language_config) return; @@ -316,15 +322,30 @@ for (l = language_config->instances; l; l = l->next) { inst = l->data; + Evas_Coord mw, mh; + evas_object_hide(inst->o_flag); + edje_object_part_unswallow(inst->o_language, inst->o_flag); if (language_config->languages) { Language *lang = evas_list_nth(language_config->languages, language_config->language_selector); - edje_object_part_text_set(inst->o_language, "langout", lang->lang_shortcut); + + snprintf(lbuf, sizeof(lbuf), "%s/images/%s.png", + e_module_dir_get(language_config->module), lang->lang_flag); + e_icon_file_set(inst->o_flag, lbuf); + edje_object_part_swallow(inst->o_language, "language_flag", inst->o_flag); + edje_object_part_text_set(inst->o_language, "langout", lang->lang_shortcut); } else - edje_object_part_text_set(inst->o_language, "langout", ""); + { + snprintf(lbuf, sizeof(lbuf), "%s/images/%s.png", + e_module_dir_get(language_config->module)); + e_icon_file_set(inst->o_flag, lbuf); + edje_object_part_swallow(inst->o_language, "language_flag", inst->o_flag); + edje_object_part_text_set(inst->o_language, "langout", ""); + } + } } @@ -380,6 +401,7 @@ { Instance *inst; Evas_Event_Mouse_Down *ev; + char buf[4096]; if (!(inst = data)) return; ev = event_info; @@ -427,8 +449,9 @@ mi = e_menu_item_new(mn); e_menu_item_label_set(mi, lang->lang_name); - //FIXME: the country flag should go here - e_util_menu_item_edje_icon_set(mi, "enlightenment/e"); + snprintf(buf, sizeof(buf), "%s/images/%s.png", + e_module_dir_get(language_config->module), lang->lang_flag); + e_menu_item_icon_file_set(mi, buf); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, SELECTED_LANG_SET_RADIO_GROUP); e_menu_item_toggle_set(mi, indx == language_config->language_selector ? 1 : 0); ------------------------------------------------------- All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs