Merge 07a95b5b33 into dev
This commit is contained in:
@@ -12,6 +12,8 @@
|
|||||||
- fix(indev) disabled object shouldn't absorb clicks but let the parent to be clicked
|
- fix(indev) disabled object shouldn't absorb clicks but let the parent to be clicked
|
||||||
- fix(arabic) support processing again already processed texts with _lv_txt_ap_proc
|
- fix(arabic) support processing again already processed texts with _lv_txt_ap_proc
|
||||||
- fix(textarea) support Arabic letter connections
|
- fix(textarea) support Arabic letter connections
|
||||||
|
- fix(dropdown) support Arabic letter connections
|
||||||
|
- fix(value_str) support Arabic letter connections in value string property
|
||||||
|
|
||||||
## v7.7.2 (Planned to 17.11.2020)
|
## v7.7.2 (Planned to 17.11.2020)
|
||||||
### Bugfixes
|
### Bugfixes
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
#include "lv_draw_blend.h"
|
#include "lv_draw_blend.h"
|
||||||
#include "lv_draw_mask.h"
|
#include "lv_draw_mask.h"
|
||||||
#include "../lv_misc/lv_math.h"
|
#include "../lv_misc/lv_math.h"
|
||||||
|
#include "../lv_misc/lv_txt_ap.h"
|
||||||
#include "../lv_core/lv_refr.h"
|
#include "../lv_core/lv_refr.h"
|
||||||
#include "../lv_misc/lv_debug.h"
|
#include "../lv_misc/lv_debug.h"
|
||||||
|
|
||||||
@@ -1295,8 +1296,16 @@ static void draw_value_str(const lv_area_t * coords, const lv_area_t * clip, con
|
|||||||
if(dsc->value_str == NULL) return;
|
if(dsc->value_str == NULL) return;
|
||||||
if(dsc->value_opa <= LV_OPA_MIN) return;
|
if(dsc->value_opa <= LV_OPA_MIN) return;
|
||||||
|
|
||||||
|
#if LV_USE_ARABIC_PERSIAN_CHARS == 0
|
||||||
|
const char * str = dsc->value_str;
|
||||||
|
#else
|
||||||
|
uint32_t str_len = _lv_txt_ap_calc_bytes_cnt(dsc->value_str);
|
||||||
|
char * str = _lv_mem_buf_get(str_len + 1);
|
||||||
|
_lv_txt_ap_proc(dsc->value_str, str);
|
||||||
|
#endif
|
||||||
|
|
||||||
lv_point_t s;
|
lv_point_t s;
|
||||||
_lv_txt_get_size(&s, dsc->value_str, dsc->value_font, dsc->value_letter_space, dsc->value_line_space, LV_COORD_MAX,
|
_lv_txt_get_size(&s, str, dsc->value_font, dsc->value_letter_space, dsc->value_line_space, LV_COORD_MAX,
|
||||||
LV_TXT_FLAG_NONE);
|
LV_TXT_FLAG_NONE);
|
||||||
|
|
||||||
lv_area_t value_area;
|
lv_area_t value_area;
|
||||||
@@ -1321,7 +1330,7 @@ static void draw_value_str(const lv_area_t * coords, const lv_area_t * clip, con
|
|||||||
label_dsc.color = dsc->value_color;
|
label_dsc.color = dsc->value_color;
|
||||||
label_dsc.opa = dsc->value_opa;
|
label_dsc.opa = dsc->value_opa;
|
||||||
|
|
||||||
lv_draw_label(&value_area, clip, &label_dsc, dsc->value_str, NULL);
|
lv_draw_label(&value_area, clip, &label_dsc, str, NULL);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
#include "../lv_font/lv_symbol_def.h"
|
#include "../lv_font/lv_symbol_def.h"
|
||||||
#include "../lv_misc/lv_anim.h"
|
#include "../lv_misc/lv_anim.h"
|
||||||
#include "../lv_misc/lv_math.h"
|
#include "../lv_misc/lv_math.h"
|
||||||
|
#include "../lv_misc/lv_txt_ap.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
@@ -211,7 +212,12 @@ void lv_dropdown_set_options(lv_obj_t * ddlist, const char * options)
|
|||||||
ext->sel_opt_id_orig = 0;
|
ext->sel_opt_id_orig = 0;
|
||||||
|
|
||||||
/*Allocate space for the new text*/
|
/*Allocate space for the new text*/
|
||||||
|
#if LV_USE_ARABIC_PERSIAN_CHARS == 0
|
||||||
size_t len = strlen(options) + 1;
|
size_t len = strlen(options) + 1;
|
||||||
|
#else
|
||||||
|
size_t len = _lv_txt_ap_calc_bytes_cnt(options) + 1;
|
||||||
|
#endif
|
||||||
|
|
||||||
if(ext->options != NULL && ext->static_txt == 0) {
|
if(ext->options != NULL && ext->static_txt == 0) {
|
||||||
lv_mem_free(ext->options);
|
lv_mem_free(ext->options);
|
||||||
ext->options = NULL;
|
ext->options = NULL;
|
||||||
@@ -222,7 +228,11 @@ void lv_dropdown_set_options(lv_obj_t * ddlist, const char * options)
|
|||||||
LV_ASSERT_MEM(ext->options);
|
LV_ASSERT_MEM(ext->options);
|
||||||
if(ext->options == NULL) return;
|
if(ext->options == NULL) return;
|
||||||
|
|
||||||
|
#if LV_USE_ARABIC_PERSIAN_CHARS == 0
|
||||||
strcpy(ext->options, options);
|
strcpy(ext->options, options);
|
||||||
|
#else
|
||||||
|
_lv_txt_ap_proc(options, ext->options);
|
||||||
|
#endif
|
||||||
|
|
||||||
/*Now the text is dynamically allocated*/
|
/*Now the text is dynamically allocated*/
|
||||||
ext->static_txt = 0;
|
ext->static_txt = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user