lv_lang: minor fixes
This commit is contained in:
@@ -75,7 +75,7 @@ void lv_lang_set_text_func(const void * (*fp)(uint16_t))
|
|||||||
* @param txt_id an ID of the text to get
|
* @param txt_id an ID of the text to get
|
||||||
* @return the `txt_id` txt on the set language
|
* @return the `txt_id` txt on the set language
|
||||||
*/
|
*/
|
||||||
void * lv_lang_get_text(uint16_t txt_id)
|
const void * lv_lang_get_text(uint16_t txt_id)
|
||||||
{
|
{
|
||||||
if(get_txt == NULL) {
|
if(get_txt == NULL) {
|
||||||
LV_LOG_WARN("lv_lang_get_text: text_func is not specified");
|
LV_LOG_WARN("lv_lang_get_text: text_func is not specified");
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ void lv_lang_set_text_func(const void * (*fp)(uint16_t));
|
|||||||
* @param txt_id an ID of the text to get
|
* @param txt_id an ID of the text to get
|
||||||
* @return the `txt_id` txt on the set language
|
* @return the `txt_id` txt on the set language
|
||||||
*/
|
*/
|
||||||
void * lv_lang_get_text(uint16_t txt_id);
|
const void * lv_lang_get_text(uint16_t txt_id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return with ID of the currently selected language
|
* Return with ID of the currently selected language
|
||||||
|
|||||||
@@ -761,7 +761,6 @@ static lv_res_t lv_label_signal(lv_obj_t * label, lv_signal_t sign, void * param
|
|||||||
} else if(sign == LV_SIGNAL_LANG_CHG) {
|
} else if(sign == LV_SIGNAL_LANG_CHG) {
|
||||||
#if USE_LV_MULTI_LANG
|
#if USE_LV_MULTI_LANG
|
||||||
if(ext->lang_txt_id != LV_LANG_TXT_ID_NONE) {
|
if(ext->lang_txt_id != LV_LANG_TXT_ID_NONE) {
|
||||||
uint8_t lang = lv_lang_act();
|
|
||||||
const char * lang_txt = lv_lang_get_text(ext->lang_txt_id);
|
const char * lang_txt = lv_lang_get_text(ext->lang_txt_id);
|
||||||
if(lang_txt) {
|
if(lang_txt) {
|
||||||
lv_label_set_text(label, lang_txt);
|
lv_label_set_text(label, lang_txt);
|
||||||
|
|||||||
Reference in New Issue
Block a user