mirror of
https://github.com/lvgl/lvgl.git
synced 2026-06-02 09:37:42 +08:00
bidi: minor fixes
This commit is contained in:
@@ -270,7 +270,7 @@
|
|||||||
* This macro is used with constants in the form of LV_<CONST> that
|
* This macro is used with constants in the form of LV_<CONST> that
|
||||||
* should also appear on lvgl binding API such as Micropython
|
* should also appear on lvgl binding API such as Micropython
|
||||||
*/
|
*/
|
||||||
#ifndef LV_EXPORT_CONST_INT(int_value)
|
#ifndef LV_EXPORT_CONST_INT
|
||||||
#define LV_EXPORT_CONST_INT(int_value)
|
#define LV_EXPORT_CONST_INT(int_value)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,12 @@ extern "C" {
|
|||||||
/*********************
|
/*********************
|
||||||
* INCLUDES
|
* INCLUDES
|
||||||
*********************/
|
*********************/
|
||||||
|
#ifdef LV_CONF_INCLUDE_SIMPLE
|
||||||
|
#include "lv_conf.h"
|
||||||
|
#else
|
||||||
|
#include "../../../lv_conf.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
|||||||
+12
-1
@@ -182,7 +182,16 @@ void lv_label_set_text(lv_obj_t * label, const char * text)
|
|||||||
|
|
||||||
/*If text is NULL then refresh */
|
/*If text is NULL then refresh */
|
||||||
if(text == NULL) {
|
if(text == NULL) {
|
||||||
|
#if LV_USE_BIDI == 0
|
||||||
lv_label_refr_text(label);
|
lv_label_refr_text(label);
|
||||||
|
#else
|
||||||
|
lv_bidi_dir_t base_dir = lv_obj_get_base_dir(label);
|
||||||
|
if(base_dir == LV_BIDI_DIR_AUTO) base_dir = lv_bidi_detect_base_dir(text);
|
||||||
|
|
||||||
|
lv_bidi_process(ext->text_ori, ext->text, base_dir);
|
||||||
|
lv_label_refr_text(label);
|
||||||
|
#endif
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,7 +223,7 @@ void lv_label_set_text(lv_obj_t * label, const char * text)
|
|||||||
strcpy(ext->text, text);
|
strcpy(ext->text, text);
|
||||||
#else
|
#else
|
||||||
ext->text_ori = lv_mem_alloc(len);
|
ext->text_ori = lv_mem_alloc(len);
|
||||||
lv_mem_assert(ext->text_ori);
|
LV_ASSERT_MEM(ext->text_ori);
|
||||||
if(ext->text_ori == NULL) return;
|
if(ext->text_ori == NULL) return;
|
||||||
|
|
||||||
strcpy(ext->text_ori, text);
|
strcpy(ext->text_ori, text);
|
||||||
@@ -1089,7 +1098,9 @@ static lv_res_t lv_label_signal(lv_obj_t * label, lv_signal_t sign, void * param
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(sign == LV_SIGNAL_BASE_DIR_CHG) {
|
else if(sign == LV_SIGNAL_BASE_DIR_CHG) {
|
||||||
|
#if LV_USE_BIDI
|
||||||
if(ext->static_txt == 0) lv_label_set_text(label, NULL);
|
if(ext->static_txt == 0) lv_label_set_text(label, NULL);
|
||||||
|
#endif
|
||||||
} else if(sign == LV_SIGNAL_GET_TYPE) {
|
} else if(sign == LV_SIGNAL_GET_TYPE) {
|
||||||
lv_obj_type_t * buf = param;
|
lv_obj_type_t * buf = param;
|
||||||
uint8_t i;
|
uint8_t i;
|
||||||
|
|||||||
Reference in New Issue
Block a user