Struct Tab

Source
pub struct Tab {
Show 16 fields pub bg: Quad, pub text: Text, pub tab_close: TabClose, pub label: String, pub is_closeable: bool, pub animator: Animator, pub z: f32, pub abs_origin: Option<Vec2>, pub _is_selected: bool, pub _is_focussed: bool, pub _bg_area: Area, pub _bg_inst: Option<InstanceArea>, pub _text_area: Area, pub _close_anim_rect: Rect, pub _is_down: bool, pub _is_drag: bool,
}

Fields§

§bg: Quad§text: Text§tab_close: TabClose§label: String§is_closeable: bool§animator: Animator§z: f32§abs_origin: Option<Vec2>§_is_selected: bool§_is_focussed: bool§_bg_area: Area§_bg_inst: Option<InstanceArea>§_text_area: Area§_close_anim_rect: Rect§_is_down: bool§_is_drag: bool

Implementations§

Source§

impl Tab

Source

pub fn proto(cx: &mut Cx) -> Self

Source

pub fn layout_bg() -> LayoutId

Source

pub fn text_style_title() -> TextStyleId

Source

pub fn instance_border_color() -> InstanceColor

Source

pub fn tab_closing() -> InstanceFloat

Source

pub fn shader_bg() -> ShaderId

Source

pub fn style(cx: &mut Cx, opt: &StyleOptions)

Source

pub fn get_bg_color(&self, cx: &Cx) -> Color

Source

pub fn get_text_color(&self, cx: &Cx) -> Color

Source

pub fn anim_default(&self, cx: &Cx) -> Anim

Source

pub fn anim_over(&self, cx: &Cx) -> Anim

Source

pub fn anim_down(&self, cx: &Cx) -> Anim

Source

pub fn anim_close(&self, _cx: &Cx) -> Anim

Source

pub fn set_tab_focus(&mut self, cx: &mut Cx, focus: bool)

Source

pub fn set_tab_selected(&mut self, cx: &mut Cx, selected: bool)

Source

pub fn set_tab_state(&mut self, cx: &mut Cx, selected: bool, focus: bool)

Source

pub fn handle_tab(&mut self, cx: &mut Cx, event: &mut Event) -> TabEvent

Source

pub fn get_tab_rect(&mut self, cx: &Cx) -> Rect

Source

pub fn begin_tab(&mut self, cx: &mut Cx) -> Result<(), ()>

Source

pub fn end_tab(&mut self, cx: &mut Cx)

Source

pub fn draw_tab(&mut self, cx: &mut Cx)

Trait Implementations§

Source§

impl Clone for Tab

Source§

fn clone(&self) -> Tab

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl Freeze for Tab

§

impl RefUnwindSafe for Tab

§

impl Send for Tab

§

impl Sync for Tab

§

impl Unpin for Tab

§

impl UnwindSafe for Tab

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.