-
Notifications
You must be signed in to change notification settings - Fork 48
Description
I'm trying to recreate the dock widgets from Qt5 in egui. Those widgets have a header with its title. This header is also a handle for dragging the widget around. If the widget is in a tab container, that header is hidden and its title is shown in the tab.
With egui_tiles I can get really close to recreating those dock widgets. However, within Behavior<Pane>::pane_ui I do not know whether the parent container is a tab container, so I cannot hide the header in that case.
I'm considering implementing support for this into egui_tiles, but want to hear your opinion about this first. Would this be a useful addition to the library? If yes, do you have any recommendation on how to implement this? Should this header be visible by default?
I see some ways to implement this:
- Replace the calls to
Tree<Pane>::tile_uiin linear.rs and grid.rs with a call to a new functionBehavior::tile_with_header_uithat in turn callsTree<Pane>::tile_ui. - Add a
draw_headerparameter toTree<Pane>::tile_uiand prefix the call toBehavior.<Pane>::pane_uiwith a conditional call to a new function Behavior.::header_ui`. - Add a
draw_headerparameter toTree<Pane>::tile_uiand pass this on toBehavior.<Pane>::pane_ui, so the user can determine if and how to draw the header.
I personally think 2 is the best option.
Thanks for creating this library and reading my message.