gpui-component/crates
Nico Gründel df57b0b847
dock: Add a way for Panels to track the tab bar they belong to (#1580)
Currently, there is no good way for a Panel in a dock to e.g. add a tab
to its own tab bar. This is especially annoying as the state in
DockArea::items isn't synced to the underlying views, meaning the
`DockArea::add_panel` function will do nothing after first splitting the
panel, and then deleting the only element in the first part of the
split.


https://github.com/user-attachments/assets/2c61f2f0-9b1c-4154-8a53-b917335b94f0

This pull request adds a function that is called when a PanelView is
added to a tabbar via `add_panel` or `insert_panel_at` or when it is
removed via `detach_panel`.

This allows for entities that implement Panel to keep track of and
directly access the tab bar they belong to, and for example add new
panels to it through buttons in the dropdown menu or the top right of
the tab bar.
2025-11-13 18:02:05 +08:00
..
macros Bump v0.4.0-preview2 2025-11-12 15:16:49 +08:00
reqwest_client Bump v0.4.0-preview2 2025-11-12 15:16:49 +08:00
story Revert "root: Render overlays inside Root element by default. (#1570)" (#1584) 2025-11-13 13:37:05 +08:00
ui dock: Add a way for Panels to track the tab bar they belong to (#1580) 2025-11-13 18:02:05 +08:00