Top level menu as a scrollable graphical list #307
Replies: 8 comments 24 replies
-
Although the exact code to do this isn't there most of the parts that would be needed are, it actually would not be particularly difficult to create an extension of the current GraphicsDeviceRenderer class that did this. Icon-drawn menu items with text formatting underneath are already available. Look at the ESPAmplifier menu example for this. I imagine all that would be needed was a full-height menu item and the arrows drawn in somehow on the left and the right. For nearly all cases I have larger screens that work better with a dashboard, then switching into the menu as needed, so this isn't something I've considered. But agreed, this would be handy for many. I'm a bit tied up now, with a few projects and the i18n support, but if you wanted to try it, I'd be happy to give guidance on where to start with this. |
Beta Was this translation helpful? Give feedback.
-
So I've thought about this, and I have to do a small release to fix an oversight in the dashboard. This can go along with that. On the display renderer I'll add another method that allows specific menus to use a horizontal card layout instead of a vertical scrolling layout. Choosing this option will allocate a bit of extra memory, to keep the left and right buttons, and a few other items in memory. this should be minimal, maybe 100 bytes or somewhere in that order. On devices that are encoders (or button-based emulations of encoders) then the active item will be the one that is on display and changing active item will work exactly as now, by turning the encoder. On touch screens clicking the left and right icon buttons will move between them (this may not be in the first version). |
Beta Was this translation helpful? Give feedback.
-
I imagine I'll have something working on master in a day or two. It is easier than I thought. You can see something very similar in ESPAmplifier, take a look at the code here: https://github.com/davetcc/tcMenuLib/blob/master/examples/esp/esp32Amplifier/esp32Amplifier.ino#L88 It adds Icon images to the cache and then sets out a grid layout. Although our case will be slightly different, you'll get the idea. My take is that we can possibly streamline the API a bit to make it a bit easier to use, and secondly (and probably more importantly) create a youtube video tutorial that shows how to use themes in detail. |
Beta Was this translation helpful? Give feedback.
-
So let's go through the procedure:
Also, note that icons can render as text and icons, meaning you shouldn't need to internationalize the icons themselves, just the name text which will render underneath. |
Beta Was this translation helpful? Give feedback.
-
It is on master now, needs a bit more work. It is called card layout. You can set any menu to work in card layout mode, in fact at the moment there is an issue with dialogs and other custom entries going into card layout, which I'll fix before releasing. Other than that it is working quite well but is subject to change. There are two examples updated to work with card layout:
There is even no reason that this should not work with touch, and I'll test it before releasing it with that too. This release really cleans up the core at the same time, putting some support (first class buttons, drawable helper) in place that had been missing for a while. |
Beta Was this translation helpful? Give feedback.
-
Not sure what coordinates you mean there, the only thing you need to set is the size of the icon and the order in which you want them to appear, starting at 1 as the row number. This is to some extent documented in the docs already https://www.thecoderscorner.com/products/arduino-libraries/tc-menu/themes/rendering-with-themes-icons-grids/ |
Beta Was this translation helpful? Give feedback.
-
Yes, at the moment the size must be correct, this is rendering on an embedded device, and interpolation is slow and costly, especially on smaller devices. Anything that looked decent with aliasing would use a lot of memory. |
Beta Was this translation helpful? Give feedback.
-
At the moment it is not fully there. Step 3 is to detect card layout and switch intent to sideways. Along with updating the three plugins that use it accordingly. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm wondering whether it would be possible to create a top level menu completely as a slideshow. After clicking on the selected icon, users would see respective submenu.
If it's not supported, is it something you'd appreciate as well?
Attached are the example designs to help you imagine what I mean.


Beta Was this translation helpful? Give feedback.
All reactions