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

Small redraw of the list rounded corners when changing items in the list #23

Open
edhelas opened this issue Jul 17, 2023 · 7 comments
Open
Labels
future update May be fixed or added in a future update rockbox issue This issue is a problem with Rockbox, not adwaitapod.

Comments

@edhelas
Copy link

edhelas commented Jul 17, 2023

When scrolling items in the list the light gray selection is displayed as a non-rounded rectangle for a few ms before being redraw with the correct border-radius corners. Can it be fixed to be drawn directly as it should ?

@D0-0K
Copy link
Owner

D0-0K commented Jul 17, 2023

Unfortunately this behaviour cannot be remedied with the current implementation. Currently this is acheived with masking the default menu items, which reloads everytime you scroll to a new item.

This can be fixed with future changes, Rockbox has a feature to draw more custom menus, however it is immature and hasn't been worked on in over 10 years. In order to use this in adwaitapod I would need it to work with features like changing the user selected menu item colour, user selected font colour etc. I have plans for how support for these can be added, but my C skills are dull so it's going to take time.

But long story short: not fixable right now, but hopefully in a future update!

@D0-0K D0-0K added rockbox issue This issue is a problem with Rockbox, not adwaitapod. future update May be fixed or added in a future update labels Jul 20, 2023
@edhelas
Copy link
Author

edhelas commented Sep 10, 2024

It seems that you were able to fix the redraw issue in the Themify 2 current work, I'm currently reading your commits and code but could not figure out yet how you handled it, from what I can guess it seems that you're using a bitmap in a moving viewport but I'm not 100% sure. If you have some small hints on how you did that I could try to do a small PR to fix this issue for the Adwaitapod theme :)

Thanks for all the awesome work !

@D0-0K
Copy link
Owner

D0-0K commented Sep 11, 2024

Hey! Thanks for following up here, actually a good time to update what would be holding this back.
So Themify has it's own menu display engine, built using the 'skinned menus' feature of Rockbox's theme engine. You pretty much have to implement all the features and settings of the menus manually, the benefit is that you can be far more creative adding true rounded corners etc but it comes at a cost of not being fully finished.

Skinned menus work by letting themes create a viewport that represents a single menu entry, and then tiles it to fill the menu viewport. There are tags to change the visuals if the item is currently selected, as well as other things. It's very rarely been used in themes, and not much beyond tech demos, hence there are many bugs which can make the process time consuming.

The big issue is still the menu selection colour. It hasn't been make accessible via theme tags, which adwaitapod would absolutely need. Themify can get away without it because the theme is built around the foreground and background colours which are available via theme tags. To use this properly in adwaitapod, we would need 4 new tags which expose settings like the line selector colours for primary, secondary and text colours as well as the line separator colour as a tag in the theme engine which sets the foreground colour of a viewport to that colour.

I more or less know how and where to implement this, but have basically no time and likely wont for a while unfortunately. But this will definitely come. Themify's menu engine is super powerful, and it will allow adwaitapod to do so much more in the future!

(also as a side note, Themify doesn't actually use bitmaps but technically uses vector graphics for the rounded corners via the font system! Hence why it's pretty difficult to understand. Sorry about that haha)

@edhelas
Copy link
Author

edhelas commented Sep 11, 2024

Well that was a lot of useful information, I actually saw the 'skinned menu' code indeed but wasn't aware you were actually using it in Themify. I'll continue to read code and understand things and see if I can actually help with something.

@D0-0K
Copy link
Owner

D0-0K commented Sep 11, 2024

Thank you! If you're proficient in reading C and would be interested in helping to add the neccesary features, I can provide all the information I've gathered thus far. Either way, feel free to ask any questions that can help!

@edhelas
Copy link
Author

edhelas commented Sep 11, 2024

I'm more of a web/PHP developer myself :D
Rockbox is more of a hobby project for my iPod. I guess you could drop all the things you have here, at least it could give some documentation for the people that might tackle this issue. I still have a lot to understand. But thanks anyway for the feedback ;)

@D0-0K
Copy link
Owner

D0-0K commented Sep 12, 2024

Sharing the notes here is a great idea!

My current route for implementing these features is to build upon the existing colour display code. In skin_parser.c at line 749 there is an if statement for the foreground colour tag where I think the code for these features should go. Using them as foreground colours makes the most sense allowing for 1-bit bitmaps, %dr rectangles and fonts to be used to draw the line selectors and dividers. I can also see the %Vs tag needing a new mode to allow viewports to be drawing the selection background and foreground (though not entirely neccesary)

For the most part, it's not the most difficult task since the code to do this mostly exists or can be riffed from other parts. Just with adding anything new to the theme engine, debugging can take time and effort, as well as making sure features are properly documented and compliant with the programming style of the Rockbox code base.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
future update May be fixed or added in a future update rockbox issue This issue is a problem with Rockbox, not adwaitapod.
Projects
None yet
Development

No branches or pull requests

2 participants