Conrod: MenuBar/ToolBar

Created on 4 May 2015  路  9Comments  路  Source: PistonDevelopers/conrod

Both are pretty essential widgets and used in a lot of applications.

MenuBar is a list of menus that have childs in them (e.g. File -> New File).
When you click a parent/top level menu button, a list of child items should pop up from below the button.

ToolBar is a widget where you can add your own widgets to them. Think of the bar in you web browser; back button, forwards button, refresh button and text box.

widget

Most helpful comment

What is the state of this widget ?
I really need them but don't have enough experience with conrod to implement a (fully) functioning version.

All 9 comments

Menu bars are basically just nested dropdowns and buttons in a layout. Toolbars are just containers for other widgets.

Of course they usually have more features, like separators and key bindings in menu bars, and drag 'n drop, grouping, etc. in tool bars. The basic components for implementing these widgets already exist.

both are essential and we need to ensure that they are accessible to all people

Yes I agree it'd be nice to have these abstracted into their own widget types, thanks for the issue :)

I was working on a container for a graph library using conrod, this may spark some ideas for you. I'm hopefully going to generalize this container in some way, so I can use it for both nodes and a tool pane.

https://github.com/PistonDevelopers/mush/commit/de1e99e91501b1edafeecd33c5dff450679dedfc

I agree that a container object should probably exist in conrod, so child widgets can track along with position, visibility, and sizing. It'd be nice to specify these sub widgets's position and sizes in percentages then, to scale with the container.

@viperscape definitely, the plan is to implement a Floating variant of the Canvas type (you can see it commented out in canvas/mod.rs). The Canvas type is pretty much the same as the Container that you describe - you can place any widget upon it and it will track it's position (see the canvas placement methods here and an example here). Currently, only the Split variant of the Canvas type is available (splits a window into sections) however I should have the Floating variant done within the next day or two :+1:

:+1: that's great news

What is the state of this widget ?
I really need them but don't have enough experience with conrod to implement a (fully) functioning version.

i'd be willing to pick this up in my spare time the next few weeks! @mitchmindtree any updates re: floating canvas? i'd start there.

@bigs since this issue was originally posted a ListSelect widget has been added that goes a long way towards this. To make a menu that drops down with submenus, you could use a stack of these ListSelects - one for each level of depth. To ensure that the lists "float" above surrounding widgets, be sure to call .floating(true) when building the ListSelect widgets. You can see a demo of how ListSelect works in the backends/conrod_glium/examples/list_select.rs example.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mitchmindtree picture mitchmindtree  路  22Comments

zengsai picture zengsai  路  10Comments

drmason13 picture drmason13  路  3Comments

SuperCuber picture SuperCuber  路  4Comments

TomboFry picture TomboFry  路  3Comments