From dd100e5e07c8ae18c6e885d97d9c5938049fff44 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 29 Oct 2019 14:33:59 +0100 Subject: [PATCH 1/6] ta: fix place holder alignment. Fixes #1241 --- src/lv_objx/lv_ta.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lv_objx/lv_ta.c b/src/lv_objx/lv_ta.c index fa44a105c..08208f5a5 100644 --- a/src/lv_objx/lv_ta.c +++ b/src/lv_objx/lv_ta.c @@ -744,12 +744,14 @@ void lv_ta_set_text_align(lv_obj_t * ta, lv_label_align_t align) lv_obj_t * label = lv_ta_get_label(ta); if(!ext->one_line) { lv_label_set_align(label, align); + if(ext->placeholder) lv_label_set_align(ext->placeholder, align); } else { /*Normal left align. Just let the text expand*/ if(align == LV_LABEL_ALIGN_LEFT) { lv_label_set_long_mode(label, LV_LABEL_LONG_EXPAND); lv_page_set_scrl_fit2(ta, LV_FIT_TIGHT, LV_FIT_FLOOD); lv_label_set_align(label, align); + if(ext->placeholder) lv_label_set_align(ext->placeholder, align); } /*Else use fix label width equal to the Text area width*/ @@ -757,6 +759,7 @@ void lv_ta_set_text_align(lv_obj_t * ta, lv_label_align_t align) lv_label_set_long_mode(label, LV_LABEL_LONG_CROP); lv_page_set_scrl_fit2(ta, LV_FIT_FLOOD, LV_FIT_FLOOD); lv_label_set_align(label, align); + if(ext->placeholder) lv_label_set_align(ext->placeholder, align); lv_obj_set_width(label, lv_page_get_fit_width(ta)); } From 3da868a0905ccbdafb4bbbf9c301d4f66eb2cf86 Mon Sep 17 00:00:00 2001 From: George Slater Date: Wed, 30 Oct 2019 17:03:56 -0500 Subject: [PATCH 2/6] lv_color1_t: Add 'ch' struct to union to fix 1bit color compilation error. lv_color.h: Updated lv_color1_t union to include 'ch' structure. This fixes compilation errors when configured for 1bit color. --- src/lv_misc/lv_color.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/lv_misc/lv_color.h b/src/lv_misc/lv_color.h index 4f994e2ef..f2aadccaa 100644 --- a/src/lv_misc/lv_color.h +++ b/src/lv_misc/lv_color.h @@ -96,10 +96,13 @@ enum { typedef union { - uint8_t blue : 1; - uint8_t green : 1; - uint8_t red : 1; - uint8_t full : 1; + struct + { + uint8_t blue : 1; + uint8_t green : 1; + uint8_t red : 1; + } ch; + uint8_t full; } lv_color1_t; typedef union From da7e67b3814f964f6bd1330cd4e583e004c2c890 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Thu, 31 Oct 2019 14:14:08 +0100 Subject: [PATCH 3/6] fix lv_cb_is_inactive --- src/lv_objx/lv_cb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lv_objx/lv_cb.h b/src/lv_objx/lv_cb.h index 5fa598b7b..a6b1e74ad 100644 --- a/src/lv_objx/lv_cb.h +++ b/src/lv_objx/lv_cb.h @@ -149,7 +149,7 @@ static inline bool lv_cb_is_checked(const lv_obj_t * cb) */ static inline bool lv_cb_is_inactive(const lv_obj_t * cb) { - return lv_btn_get_state(cb) == LV_BTN_STATE_INA ? false : true; + return lv_btn_get_state(cb) == LV_BTN_STATE_INA ? true :false; } /** From fb9fb8d09e25189c0208e75b96607de9a72219f4 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Thu, 31 Oct 2019 19:24:41 +0100 Subject: [PATCH 4/6] add LV_LABEL_TEXT_SEL_OFF again --- src/lv_objx/lv_label.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lv_objx/lv_label.h b/src/lv_objx/lv_label.h index 25277ed2d..a5eafd48f 100644 --- a/src/lv_objx/lv_label.h +++ b/src/lv_objx/lv_label.h @@ -33,6 +33,7 @@ extern "C" { *********************/ #define LV_LABEL_DOT_NUM 3 #define LV_LABEL_POS_LAST 0xFFFF +#define LV_LABEL_TEXT_SEL_OFF LV_DRAW_LABEL_NO_TXT_SEL LV_EXPORT_CONST_INT(LV_LABEL_DOT_NUM); LV_EXPORT_CONST_INT(LV_LABEL_POS_LAST); From 982e2036cf068c7e3e2378bc395acd5ac940d329 Mon Sep 17 00:00:00 2001 From: Themba Dube Date: Thu, 31 Oct 2019 20:18:50 -0400 Subject: [PATCH 5/6] Fix inconsistency between lv_debug.c and lv_debug.h --- src/lv_core/lv_debug.c | 3 ++- src/lv_core/lv_debug.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lv_core/lv_debug.c b/src/lv_core/lv_debug.c index 28d09d1da..f5b02d541 100644 --- a/src/lv_core/lv_debug.c +++ b/src/lv_core/lv_debug.c @@ -7,6 +7,7 @@ * INCLUDES *********************/ #include "lv_obj.h" +#include "lv_debug.h" #if LV_USE_DEBUG @@ -126,7 +127,7 @@ bool lv_debug_check_str(const void * str) return false; } -void lv_debug_log_error(const char * msg, unsigned long int value) +void lv_debug_log_error(const char * msg, uint64_t value) { static const char hex[] = "0123456789ABCDEF"; diff --git a/src/lv_core/lv_debug.h b/src/lv_core/lv_debug.h index f66fb65b4..f9b8082dd 100644 --- a/src/lv_core/lv_debug.h +++ b/src/lv_core/lv_debug.h @@ -34,7 +34,7 @@ bool lv_debug_check_obj_type(const lv_obj_t * obj, const char * obj_type); bool lv_debug_check_obj_valid(const lv_obj_t * obj); -bool lv_debug_check_style(const void * str); +bool lv_debug_check_style(const lv_style_t * style); bool lv_debug_check_str(const void * str); From 8db8470a6089ef11abd6d24bb64cc1dc3221428e Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Sat, 2 Nov 2019 21:34:41 +0100 Subject: [PATCH 6/6] lv_ta_set_placeholder_text: fix placholder align --- src/lv_objx/lv_ta.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lv_objx/lv_ta.c b/src/lv_objx/lv_ta.c index 08208f5a5..0bcda4c9a 100644 --- a/src/lv_objx/lv_ta.c +++ b/src/lv_objx/lv_ta.c @@ -541,6 +541,9 @@ void lv_ta_set_placeholder_text(lv_obj_t * ta, const char * txt) lv_label_set_text(ext->placeholder, txt); + /*Refresh the placeholder's align*/ + lv_ta_set_text_align(ta, lv_label_get_align(ext->label)); + placeholder_update(ta); }