Trait egui_dock::Tab

source ·
pub trait Tab {
    fn ui(&mut self, ui: &mut Ui);
    fn title(&mut self) -> WidgetText;

    fn context_menu(&mut self, _ui: &mut Ui) { ... }
    fn on_close(&mut self) -> bool { ... }
    fn force_close(&mut self) -> bool { ... }
    fn inner_margin(&self) -> Margin { ... }
    fn clear_background(&self) -> bool { ... }
}
👎Deprecated
Expand description

Dockable tab that can be used in crate::Trees.

Required Methods§

👎Deprecated

Actual tab content.

👎Deprecated

The title to be displayed.

Provided Methods§

👎Deprecated

Content inside context_menu.

👎Deprecated

This is called when the tabs close button is pressed.

Returns true if the tab should close immediately, false otherwise.

NOTE if returning false ui will still be called once more if this tab is active.

Examples found in repository?
src/dynamic_tab.rs (line 224)
223
224
225
    fn on_close(&mut self, tab: &mut Self::Tab) -> bool {
        tab.on_close()
    }
👎Deprecated

This is called every frame after ui is called (if the tab is active).

Returns true if the tab should be forced to close, false otherwise.

In the event this function returns true the tab will be removed without calling on_close.

Examples found in repository?
src/dynamic_tab.rs (line 228)
227
228
229
    fn force_close(&mut self, tab: &mut Self::Tab) -> bool {
        tab.force_close()
    }
👎Deprecated

Sets the margins between tab’s borders and its contents.

👎Deprecated

Whether the tab will be cleared with the color specified in Style::tab_background_color

Examples found in repository?
src/dynamic_tab.rs (line 232)
231
232
233
    fn clear_background(&self, tab: &Self::Tab) -> bool {
        tab.clear_background()
    }

Implementors§