Comments (3)
Hi @zylalx1,
Good find and thanks for the rigorous analysis! This probably hasn't been discovered because pre-setting text and using password mode together is less common.
Some or all of the below changes could help hide the characters immediately and refresh the bullet. We'll get others' opinions.
lv_textarea_set_text
(your//4
): It calledauto_hide_characters
but that only starts the countdown towards hiding them. If the the show time had already been set to zero, this works unmodified. Hiding the new text immediately is probably desirable for all show times.lv_textarea_set_password_bullet
(your//3
): It calledlv_obj_invalidate
but as you discovered, it doesn't work. That's because the the temporary bullet buffer needed to be reloaded.lv_textarea_set_password_show_time
(your//2
): An in-progress hide continued unaffected.
A drawback of using pwd_char_hider
everywhere is that the in-progress show time countdown gets cancelled. If you wanted to have the bullet symbol flip between "X" and "#" rapidly the show time would be totally overridden.
diff --git a/src/widgets/textarea/lv_textarea.c b/src/widgets/textarea/lv_textarea.c
index 241f6753e..60780113d 100644
--- a/src/widgets/textarea/lv_textarea.c
+++ b/src/widgets/textarea/lv_textarea.c
@@ -316,8 +316,7 @@ void lv_textarea_set_text(lv_obj_t * obj, const char * txt)
LV_ASSERT_MALLOC(ta->pwd_tmp);
if(ta->pwd_tmp == NULL) return;
- /*Auto hide characters*/
- auto_hide_characters(obj);
+ pwd_char_hider(obj);
}
lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL);
@@ -469,7 +468,7 @@ void lv_textarea_set_password_bullet(lv_obj_t * obj, const char * bullet)
ta->pwd_bullet[txt_len] = '\0';
}
- lv_obj_invalidate(obj);
+ pwd_char_hider(obj);
}
void lv_textarea_set_one_line(lv_obj_t * obj, bool en)
@@ -544,6 +543,7 @@ void lv_textarea_set_password_show_time(lv_obj_t * obj, uint32_t time)
lv_textarea_t * ta = (lv_textarea_t *)obj;
ta->pwd_show_time = time;
+ pwd_char_hider(obj);
}
void lv_textarea_set_align(lv_obj_t * obj, lv_text_align_t align)
I have some other tweaks but I'll save them for the potential PR.
from lvgl.
We need some feedback on this issue.
Now we mark this as "stale" because there was no activity here for 14 days.
Remove the "stale" label or comment else this will be closed in 7 days.
from lvgl.
Let's continue in the PR.
from lvgl.
Related Issues (20)
- Problem with lv_demo_widgets demo(Instrument panel) after porting code to hardware HOT 1
- Button Matrix cannot be removed from lv_conf.h HOT 1
- Tiny TTF causes crash in certain situations HOT 1
- Tiny TTF should be caching stbtt_FindGlyphIndex HOT 26
- Line 11 of src/libs/tiny_ttf.c declared incorrectly HOT 1
- Docs build break HOT 1
- 8.4/9.1 Hardware based display rotation input devices HOT 5
- LV_COLOR_16_SWAP removal and performance HOT 2
- About the Release Date of New Versions HOT 2
- Slider Indicator Bigger Image Replacement on Press Event HOT 1
- "Does the lv_fs_dir_open function support opening directories with Chinese paths?" HOT 1
- ESP32 SPIFFS HOT 4
- animation LV_ANIM_REPEAT_INFINITE not works? HOT 1
- Overflow focus not handled correctly on full_refresh=0 HOT 1
- FPS and Fragmentation HOT 1
- How to use evdev in v9? HOT 7
- Adding border to different sides HOT 2
- Lottile on web pages https://docs.lvgl.io/master/widgets/lottie.html ,there is no button to view the C code
- Slider only changes value when moved HOT 2
- Tiny TTF lib: lv_tiny_ttf_set_size() should be removed or clear the cache HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lvgl.