Skip to content

Headers for tiles not contained in a tab container #96

@bcmpinc

Description

@bcmpinc

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:

  1. Replace the calls to Tree<Pane>::tile_ui in linear.rs and grid.rs with a call to a new function Behavior::tile_with_header_ui that in turn calls Tree<Pane>::tile_ui.
  2. Add a draw_header parameter to Tree<Pane>::tile_ui and prefix the call to Behavior.<Pane>::pane_ui with a conditional call to a new function Behavior.::header_ui`.
  3. Add a draw_header parameter to Tree<Pane>::tile_ui and pass this on to Behavior.<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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions