lvgl
lvgl copied to clipboard
fix(theme_default): fix omitted style for selected text in `lv_textarea`
Selected text, even though it existed, was not showing up in TextArea examples. The bug was merely a style to show the text as selected was omitted from the Default Theme -- remedied with this PR.
Credit goes to @kisvegabor for finding the cause.
Resolves #7321
Notes
- Update the Documentation if needed. n/a
- Add Examples if relevant. n/a
- Add Tests if applicable. n/a
- If you added new options to
lv_conf_template.hrun lv_conf_internal_gen.py and update Kconfig. n/a - Run
scripts/code-format.py(astyle v3.4.12needs to installed by runningcd scripts; ./install_astyle.sh) and follow the Code Conventions. Done. - Mark the Pull request as Draft while you are working on the first version, and mark is as Ready when it's ready for review. Done.
- When changes were requested, re-request review to notify the maintainers. Done.
- Help us to review this Pull Request! Anyone can approve or request changes.
Sorry, I'm trying to verify the fix. Should it be possible in lv_example_textarea_1 to select text in the textarea with this fix? I can't seem to get the text to be selected with my pointer indev. It would be good to have this.
Sorry, I'm trying to verify the fix. Should it be possible in
lv_example_textarea_1to select text in the textarea with this fix? I can't seem to get the text to be selected with my pointer indev. It would be good to have this.
Hi, @liamHowatt !
That example wasn't meant to have text selected, but if you want to set it up as a test environment, you merely need to add this line of code somewhere after the lv_textarea_t object is created:
lv_textarea_set_text_selection(ta, true);
I wonder if it might be a good idea to install that line permanently. @kisvegabor Thoughts?
We should rather write a simple screen shot compare test for it here.
We should rather write a simple screen shot compare test for it here.
Excellent idea! Is there a project going on to implement TDD in LVGL? I see a lot of tests being added, and I find it encouraging! (I've worked on projects where there is a thorough test bed, and they were wonderful to work with and added so much certainty at release time!)
It's not test driven but we at least test what we already have and what we newly add.
Just a very minor comment, The two commits are necessary? style fixing at the part of the code changed it is implicitly part of the commit scope.
I suggest to squash into a single commit, and if needed mention in the commit body the style fix.
I suggest to squash into a single commit, and if needed mention in the commit body the style fix.
It is my understanding that when this is merged it effectively does squash the 2 commits together. Then this branch is deleted and git will eventually clean up (i.e. delete) those 2 commits after a while since the reference to them (the branch) is gone. So at the moment, it is simply a record of that fact that I forgot to run code-format.py locally and only found out about the problem after I submitted the first commit.
It's not test driven but we at least test what we already have and what we newly add.
Hi, Gábor!
I had a situation today where I needed to update one of the tests — specifically test_scale.c and I could not find what calls these tests. The code I added I tested elsewhere (in one of the scale examples) so I know it works, but still it would be nice to be able to utilize these. Can you advise?
I suggest to squash into a single commit, and if needed mention in the commit body the style fix.
Unless it's explicitly requested by the author of PR we squash the PRs anyways.
I had a situation today where I needed to update one of the tests — specifically test_scale.c and I could not find what calls these tests. The code I added I tested elsewhere (in one of the scale examples) so I know it works, but still it would be nice to be able to utilize these. Can you advise?
You can run the tests locally like this:
cd tests
./main.py test
See more info here.
You can run the tests locally like this:
Thank you!
Did it work?
Did it work?
No. I walked it through a debugger and it is failing at attempting to call this on my system:
cmake --build E:\Dev\Clients\WGA\lvgl\vwheeler63\lvgl\tests\build_test_sysheap --parallel 4
When I try it on my command line from the ./tests/ directory as the script does, cmake.exe starts, but aborts with an error message: "Error: could not load cache". My ./tests/build_test_sysheap/ directory is empty.
Reading ./tests/README.md now....
Installed prerequisites.... Ran without error.
But cmake is still reporting "Error: could not load cache". And I don't know enough about CMake to pursue.
I recommend using WSL under Windows. :slightly_frowning_face:
Great find and great solution.
Credit goes to @kisvegabor for the solution on this one. I just "helped". 😄
I recommend using WSL under Windows.
Got it. Thank you! One of these days I'm gonna have to break out my Ubuntu WSL....