use std::cmp::Ordering; use gpui::{AnyElement, IntoElement, Stateful}; use smallvec::SmallVec; use crate::prelude::*; /// The position of a [`Tab`] within a list of tabs. #[derive(Debug, PartialEq, Eq, Clone, Copy)] pub enum TabPosition { /// The tab is first in the list. First, /// The tab is in the middle of the list (i.e., it is not the first or last tab). /// /// The [`Ordering`] is where this tab is positioned with respect to the selected tab. Middle(Ordering), /// The tab is last in the list. Last, } #[derive(Debug, PartialEq, Eq, Clone, Copy)] pub enum TabCloseSide { Start, End, } #[derive(IntoElement, RegisterComponent)] pub struct Tab { div: Stateful