[−][src]Struct druid::widget::Tabs
A tabs widget.
The tabs can be provided up front, using Tabs::new() and add_tab()/with_tab().
Or, the tabs can be derived from the input data by implementing TabsPolicy, and providing it to Tabs::from_policy()
use druid::widget::{Tabs, Label, WidgetExt}; use druid::{Data, Lens}; #[derive(Data, Clone, Lens)] struct AppState{ name: String } let tabs = Tabs::new() .with_tab("Connection", Label::new("Connection information")) .with_tab("Proxy", Label::new("Proxy settings")) .lens(AppState::name);
Implementations
impl<T: Data> Tabs<StaticTabs<T>>
[src]
pub fn new() -> Self
[src]
Create a new Tabs widget, using the static tabs policy. Use with_tab or add_tab to configure the set of tabs available.
impl<TP: TabsPolicy> Tabs<TP>
[src]
pub fn for_policy(tabs: TP) -> Self
[src]
Create a Tabs widget using the provided policy. This is useful for tabs derived from data.
pub fn with_axis(self, axis: Axis) -> Self
[src]
Lay out the tab bar along the provided axis.
pub fn with_edge(self, edge: TabsEdge) -> Self
[src]
Put the tab bar on the specified edge of the cross axis.
pub fn with_transition(self, transition: TabsTransition) -> Self
[src]
Use the provided transition when tabs change
pub fn with_tab(
self,
name: impl Into<LabelText<TP::Input>>,
child: impl Widget<TP::Input> + 'static
) -> Tabs<TP> where
TP: AddTab,
[src]
self,
name: impl Into<LabelText<TP::Input>>,
child: impl Widget<TP::Input> + 'static
) -> Tabs<TP> where
TP: AddTab,
Available when the policy implements AddTab - e.g StaticTabs. Return this Tabs widget with the named tab added.
pub fn add_tab(
&mut self,
name: impl Into<LabelText<TP::Input>>,
child: impl Widget<TP::Input> + 'static
) where
TP: AddTab,
[src]
&mut self,
name: impl Into<LabelText<TP::Input>>,
child: impl Widget<TP::Input> + 'static
) where
TP: AddTab,
Available when the policy implements AddTab - e.g StaticTabs. Return this Tabs widget with the named tab added.
Trait Implementations
impl<T: Data> Default for Tabs<StaticTabs<T>>
[src]
impl<TP: TabsPolicy> Widget<<TP as TabsPolicy>::Input> for Tabs<TP>
[src]
pub fn event(
&mut self,
ctx: &mut EventCtx<'_, '_>,
event: &Event,
data: &mut TP::Input,
env: &Env
)
[src]
&mut self,
ctx: &mut EventCtx<'_, '_>,
event: &Event,
data: &mut TP::Input,
env: &Env
)
pub fn lifecycle(
&mut self,
ctx: &mut LifeCycleCtx<'_, '_>,
event: &LifeCycle,
data: &TP::Input,
env: &Env
)
[src]
&mut self,
ctx: &mut LifeCycleCtx<'_, '_>,
event: &LifeCycle,
data: &TP::Input,
env: &Env
)
pub fn update(
&mut self,
ctx: &mut UpdateCtx<'_, '_>,
_old_data: &TP::Input,
data: &TP::Input,
env: &Env
)
[src]
&mut self,
ctx: &mut UpdateCtx<'_, '_>,
_old_data: &TP::Input,
data: &TP::Input,
env: &Env
)
pub fn layout(
&mut self,
ctx: &mut LayoutCtx<'_, '_>,
bc: &BoxConstraints,
data: &TP::Input,
env: &Env
) -> Size
[src]
&mut self,
ctx: &mut LayoutCtx<'_, '_>,
bc: &BoxConstraints,
data: &TP::Input,
env: &Env
) -> Size
pub fn paint(
&mut self,
ctx: &mut PaintCtx<'_, '_, '_>,
data: &TP::Input,
env: &Env
)
[src]
&mut self,
ctx: &mut PaintCtx<'_, '_, '_>,
data: &TP::Input,
env: &Env
)
Auto Trait Implementations
impl<TP> !RefUnwindSafe for Tabs<TP>
[src]
impl<TP> !Send for Tabs<TP>
[src]
impl<TP> !Sync for Tabs<TP>
[src]
impl<TP> Unpin for Tabs<TP> where
TP: Unpin,
<TP as TabsPolicy>::Build: Unpin,
<TP as TabsPolicy>::Input: Unpin,
[src]
TP: Unpin,
<TP as TabsPolicy>::Build: Unpin,
<TP as TabsPolicy>::Input: Unpin,
impl<TP> !UnwindSafe for Tabs<TP>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> RoundFrom<T> for T
pub fn round_from(x: T) -> T
impl<T, U> RoundInto<U> for T where
U: RoundFrom<T>,
U: RoundFrom<T>,
pub fn round_into(self) -> U
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,