pub struct TabBarUI {
pub hovered_tab: Option<TabId>,
pub close_hovered: Option<TabId>,
pub show_new_tab_profile_menu: bool,
/* private fields */
}Expand description
Tab bar UI state
Fields§
§hovered_tab: Option<TabId>Currently hovered tab ID
close_hovered: Option<TabId>Tab where close button is hovered
Whether the new-tab profile popup is open
Implementations§
Source§impl TabBarUI
impl TabBarUI
Sourcepub fn handle_mouse_wheel(
&mut self,
delta: &MouseScrollDelta,
tab_min_width: f32,
tab_count: usize,
) -> bool
pub fn handle_mouse_wheel( &mut self, delta: &MouseScrollDelta, tab_min_width: f32, tab_count: usize, ) -> bool
Handle mouse wheel when hovering over the horizontal tab bar.
Converts vertical scroll delta to horizontal tab scrolling.
Returns true if the event was consumed.
Source§impl TabBarUI
impl TabBarUI
Sourcepub fn should_show(&self, tab_count: usize, mode: TabBarMode) -> bool
pub fn should_show(&self, tab_count: usize, mode: TabBarMode) -> bool
Check if tab bar should be visible
Sourcepub fn is_dragging(&self) -> bool
pub fn is_dragging(&self) -> bool
Check if a drag operation is in progress
Sourcepub fn render(
&mut self,
ctx: &mut Ui,
tabs: &TabManager,
config: &Config,
profiles: &ProfileManager,
right_reserved_width: f32,
) -> TabBarAction
pub fn render( &mut self, ctx: &mut Ui, tabs: &TabManager, config: &Config, profiles: &ProfileManager, right_reserved_width: f32, ) -> TabBarAction
Render the tab bar and return any action triggered
Sourcepub fn get_height(&self, tab_count: usize, config: &Config) -> f32
pub fn get_height(&self, tab_count: usize, config: &Config) -> f32
Get the tab bar height (0 if hidden or if position is Left)
Sourcepub fn get_width(&self, tab_count: usize, config: &Config) -> f32
pub fn get_width(&self, tab_count: usize, config: &Config) -> f32
Get the tab bar width (non-zero only for Left position, 0 if hidden)
Check if the context menu is currently open
Check if the in-app menu’s drop-down is open.
True only on platforms that draw it (Linux/BSD, or a forced-on run —
see crate::menu::AppMenuUi::enabled). While it is open, keyboard
input should be routed to egui rather than the terminal.
Sourcepub fn tab_at_logical_pos(&self, pos: Pos2) -> Option<TabId>
pub fn tab_at_logical_pos(&self, pos: Pos2) -> Option<TabId>
Return the tab ID at the given egui logical-pixel position, using the
tab rects cached from the last render frame. Returns None if the
position doesn’t fall inside any rendered tab.
Sourcepub fn is_renaming(&self) -> bool
pub fn is_renaming(&self) -> bool
Check if the tab rename text field is active
Sourcepub fn calculate_drop_target_horizontal(
tab_rects: &[(TabId, Rect)],
drag_source_index: Option<usize>,
pointer_x: f32,
) -> Option<usize>
pub fn calculate_drop_target_horizontal( tab_rects: &[(TabId, Rect)], drag_source_index: Option<usize>, pointer_x: f32, ) -> Option<usize>
Calculate the drop target insert index for a horizontal drag given a pointer x position.
Returns None if the drop would be a no-op (same position as source), or
Some(insert_index) for a valid insertion point.
This is a pure helper that can be tested without egui rendering.
Sourcepub fn insertion_to_target_index(
insert_index: usize,
drag_source_index: Option<usize>,
) -> usize
pub fn insertion_to_target_index( insert_index: usize, drag_source_index: Option<usize>, ) -> usize
Convert an insertion index to an effective target index, accounting for source removal.
When a tab is removed from source_index and re-inserted at insert_index, indices
after the source shift down by one. This helper applies that adjustment.
Sourcepub fn horizontal_tab_content_origin_x(
tab_area_left: f32,
scroll_offset: f32,
) -> f32
pub fn horizontal_tab_content_origin_x( tab_area_left: f32, scroll_offset: f32, ) -> f32
Calculate the x origin for horizontally scrolled tab content.
A larger scroll offset reveals tabs further to the right, so the content itself must move left inside the clipped tab area.
Sourcepub fn test_set_drag_state(&mut self, tab_id: Option<TabId>, in_progress: bool)
pub fn test_set_drag_state(&mut self, tab_id: Option<TabId>, in_progress: bool)
Set drag state directly; used by integration tests to exercise state transitions without requiring a live egui render loop.
Sourcepub fn test_set_drop_target(&mut self, index: Option<usize>)
pub fn test_set_drop_target(&mut self, index: Option<usize>)
Set the drop target index directly; used by integration tests.
Sourcepub fn test_drop_target_index(&self) -> Option<usize>
pub fn test_drop_target_index(&self) -> Option<usize>
Get the current drop target index; used by integration tests.
Sourcepub fn test_dragging_tab(&self) -> Option<TabId>
pub fn test_dragging_tab(&self) -> Option<TabId>
Get the id of the tab currently being dragged; used by integration tests.
Open the context menu for a specific tab; used by integration tests.
Close the context menu; used by integration tests.
Get the context menu tab id; used by integration tests.
Get the tab ID for which the context menu is currently open, if any.
Sourcepub fn test_set_renaming(&mut self, value: bool)
pub fn test_set_renaming(&mut self, value: bool)
Set rename mode active/inactive; used by integration tests.
Sourcepub fn test_set_tab_rects(&mut self, rects: Vec<(TabId, Rect)>)
pub fn test_set_tab_rects(&mut self, rects: Vec<(TabId, Rect)>)
Set cached tab rects directly; used by integration tests to exercise
tab_at_logical_pos without requiring a live egui render pass.
Sourcepub fn test_set_horizontal_scroll_state(
&mut self,
needs_scroll: bool,
scroll_offset: f32,
)
pub fn test_set_horizontal_scroll_state( &mut self, needs_scroll: bool, scroll_offset: f32, )
Set horizontal scroll state directly for integration tests.
Sourcepub fn test_scroll_offset(&self) -> f32
pub fn test_scroll_offset(&self) -> f32
Get the current horizontal scroll offset for integration tests.
Sourcepub fn set_move_tab_context(
&mut self,
gateway_active: bool,
tab_count: usize,
candidates: Vec<(WindowId, String)>,
context_tab_has_multiple_panes: bool,
)
pub fn set_move_tab_context( &mut self, gateway_active: bool, tab_count: usize, candidates: Vec<(WindowId, String)>, context_tab_has_multiple_panes: bool, )
Update the move-tab context shown in the right-click context menu.
Must be called each frame before render() so the context menu has
fresh state.
Trait Implementations§
Source§impl UIElement for TabBarUI
impl UIElement for TabBarUI
Source§fn is_visible(&self, ctx: Self::Ctx<'_>) -> bool
fn is_visible(&self, ctx: Self::Ctx<'_>) -> bool
Returns true when the tab bar is configured to show given the current
tab count and config.tab_bar_mode.
Source§fn height_logical(&self, ctx: Self::Ctx<'_>) -> f32
fn height_logical(&self, ctx: Self::Ctx<'_>) -> f32
Effective height of the tab bar in logical pixels.
Non-zero only when the bar is visible and positioned horizontally (top or bottom). Returns 0.0 for a left-side tab bar.
Source§fn width_logical(&self, ctx: Self::Ctx<'_>) -> f32
fn width_logical(&self, ctx: Self::Ctx<'_>) -> f32
Effective width of the tab bar in logical pixels.
Non-zero only when the bar is visible and positioned on the left side. Returns 0.0 for top/bottom tab bars.
Source§fn is_capturing_input(&self) -> bool
fn is_capturing_input(&self) -> bool
Returns true when the tab rename field or a context menu is open,
indicating that keyboard input should not be forwarded to the terminal.
Auto Trait Implementations§
impl Freeze for TabBarUI
impl RefUnwindSafe for TabBarUI
impl Send for TabBarUI
impl Sync for TabBarUI
impl Unpin for TabBarUI
impl UnsafeUnpin for TabBarUI
impl UnwindSafe for TabBarUI
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().