iced_aw
iced_aw copied to clipboard
[WIP] Menu widget
First draft of a Menu
widget.
Open TODOs:
- [x] Disable entries. This could be achieved by changing
Message
toOptional<Message>
. - [x] Toggle-able entries. This could be achieved by adding a
Entry::Toggle
or something toEntry
. - [x] Cool looking separators between the entries.
- [x] Bouncing on the edge of the window or else the menu is cut off.
- [ ] ~Add some internal scrollable if the list of entries is to high for the window.~ This seems to be realy hacky to implement. Nevertheless it would require for the
scrollable::State
to be hashable and maybe to fix this first. - [ ] Maybe a cooler default style. Some suggestions?
- [ ] Add some way of keyboard control. In common, the
Alt
+[First character of section label]
combination is used to pop up the content of the specific section. This would require to change theText
label of theSection
to a normalString
(or&str
) to be able to know the first character of the label.
This is very nice! I was thinking of making something like this for my chat app since using a PickList as a menu was hacky, but looks like you were faster :P
It seems we can use anything that can Into<Element<_>>
for menu entries which is appreciated. Something that would be nice is methods on Menu
that would help with prototyping, eg. perhaps a method that takes an array of strings for easier creation of text-only Menu
s etc.
Hmm for styling lets just stick with a workable default. Also scroll-able stuff should be fixed to render properly since a few versions back. a few keyboard controls would be nice probably can try to help implement them later. Also the pure edition might also fix the state hashing requirements for the scrollbars.
@genusistimelord For now, I would prefer to wait for the support of the real system menus (iced#1047, iced#114). What do you say?
@genusistimelord For now, I would prefer to wait for the support of the real system menus (iced#1047, iced#114). What do you say?
yeah thats fine. was more or less stating how the current changes in iced have already changed some of the requirements.
I am closing this since menu now exists. Decided to allow it since this cant be supported fully in other ways. we might not see its support for a long time if any.