Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlight Implement #2

Closed
kaiakz opened this issue Aug 23, 2019 · 2 comments
Closed

Highlight Implement #2

kaiakz opened this issue Aug 23, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@kaiakz
Copy link
Owner

kaiakz commented Aug 23, 2019

It is great to highlight the selected item.
I have finished the swapping data between JS and WASM, JS can get a string(widget attribute) from WASM and parse it into JSON.
截图_2019-08-23_09-10-21
We can get the position and size of the widget now, it's time to achieve the highlight, I think there are some ways:

In Browser, since WASM displays on a Canvas

  • Use JavaScript to draw rectangles on it.
  • Use WebAPI to draw the Canvas.

In WASM:

  • Use SDL to draw.

  • Simulate the lv_group: I found the widgets in lv_group have the highligh. @kisvegabor @embeddedt How can I simulate it, can you show some details about lv_group
    深度录屏_选择区域_20190823093351

  • Change the selected widget style: border, colour, etc.

@kaiakz kaiakz added the enhancement New feature or request label Aug 23, 2019
@kisvegabor
Copy link

kisvegabor commented Aug 23, 2019

In my opinion, it's better to use the SDL or JavaScript to display a rectangle because it will give more flexibility later.

The purpose of groups is to enable keyboard/encoder navigation and highlighting is designed to work well with typical selectable objects. Some issues:

  • If you select a button the label on it also will have orangish color.
  • If you set an orange color for something the default highlighting won't be really visible.
  • There are some special style settings with some object types (a lot of transparent parts) where highlighting might not give the expected result.

So, in summary, I think manually drawing a rectangle will give a more flexible and predictable result.

@kaiakz
Copy link
Owner Author

kaiakz commented Sep 4, 2019

OK, I use JS to the CANVAS. Due to WASM also draw on CANVAS, highlights sometimes can't display normally, I might fix it later.

@kaiakz kaiakz closed this as completed Sep 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants