pub type HorizontalSegmentedButton<'a, SelectionMode, Message> = SegmentedButton<'a, Horizontal, SelectionMode, Message>;
Expand description
Horizontal SegmentedButton
.
Aliased Type§
struct HorizontalSegmentedButton<'a, SelectionMode, Message> { /* private fields */ }
Implementations
Source§impl<'a, Variant, SelectionMode, Message> SegmentedButton<'a, Variant, SelectionMode, Message>
impl<'a, Variant, SelectionMode, Message> SegmentedButton<'a, Variant, SelectionMode, Message>
pub fn new(model: &'a Model<SelectionMode>) -> Self
Sourcepub fn on_activate<T>(self, on_activate: T) -> Self
pub fn on_activate<T>(self, on_activate: T) -> Self
Emitted when a tab is pressed.
Sourcepub fn on_context<T>(self, on_context: T) -> Self
pub fn on_context<T>(self, on_context: T) -> Self
Emitted when a button is right-clicked.
Sourcepub fn on_middle_press<T>(self, on_middle_press: T) -> Self
pub fn on_middle_press<T>(self, on_middle_press: T) -> Self
Emitted when the middle mouse button is pressed on a button.
Sourcepub fn on_dnd_drop<D: AllowedMimeTypes>(
self,
dnd_drop_handler: impl Fn(Entity, Option<D>, DndAction) -> Message + 'static,
) -> Self
pub fn on_dnd_drop<D: AllowedMimeTypes>( self, dnd_drop_handler: impl Fn(Entity, Option<D>, DndAction) -> Message + 'static, ) -> Self
Handle the dnd drop event.
Sourcepub fn on_dnd_enter(
self,
dnd_enter_handler: impl Fn(Entity, Vec<String>) -> Message + 'static,
) -> Self
pub fn on_dnd_enter( self, dnd_enter_handler: impl Fn(Entity, Vec<String>) -> Message + 'static, ) -> Self
Handle the dnd enter event.
Sourcepub fn on_dnd_leave(
self,
dnd_leave_handler: impl Fn(Entity) -> Message + 'static,
) -> Self
pub fn on_dnd_leave( self, dnd_leave_handler: impl Fn(Entity) -> Message + 'static, ) -> Self
Handle the dnd leave event.
Sourcepub fn get_drag_id(&self) -> u128
pub fn get_drag_id(&self) -> u128
Returns the drag id of the destination.
§Panics
Panics if the destination has been assigned a Set id, which is invalid.
Source§impl<'a, Variant, SelectionMode, Message> SegmentedButton<'a, Variant, SelectionMode, Message>
impl<'a, Variant, SelectionMode, Message> SegmentedButton<'a, Variant, SelectionMode, Message>
Sourcepub fn close_icon(self, value: Icon) -> Self
pub fn close_icon(self, value: Icon) -> Self
The icon used for the close button.
Sourcepub fn scrollable_focus(self, value: bool) -> Self
pub fn scrollable_focus(self, value: bool) -> Self
Scrolling switches focus between tabs.
Sourcepub fn show_close_icon_on_hover(self, value: bool) -> Self
pub fn show_close_icon_on_hover(self, value: bool) -> Self
Show the close icon only when item is hovered.
Alignment of button contents.
Padding around a button.
Desired height of a button.
Spacing between icon and text in button.
Maximum width of a button.
Minimum width of a button.
Sourcepub fn indent_spacing(self, value: u16) -> Self
pub fn indent_spacing(self, value: u16) -> Self
Spacing for each indent.
Sourcepub fn font_active(self, value: Option<Font>) -> Self
pub fn font_active(self, value: Option<Font>) -> Self
Desired font for active tabs.
Sourcepub fn font_hovered(self, value: Option<Font>) -> Self
pub fn font_hovered(self, value: Option<Font>) -> Self
Desired font for hovered tabs.
Sourcepub fn font_inactive(self, value: Option<Font>) -> Self
pub fn font_inactive(self, value: Option<Font>) -> Self
Desired font for inactive tabs.
Sourcepub fn line_height(self, value: LineHeight) -> Self
pub fn line_height(self, value: LineHeight) -> Self
LineHeight of the font.
pub fn mimes(self, value: Vec<String>) -> Self
pub fn drag_id(self, value: DragId) -> Self
Trait Implementations
Source§impl<'a, SelectionMode, Message> SegmentedVariant for SegmentedButton<'a, Horizontal, SelectionMode, Message>
impl<'a, SelectionMode, Message> SegmentedVariant for SegmentedButton<'a, Horizontal, SelectionMode, Message>
Source§fn variant_appearance(theme: &Theme, style: &SegmentedButton) -> Appearance
fn variant_appearance(theme: &Theme, style: &SegmentedButton) -> Appearance
Source§impl<'a, Variant, SelectionMode, Message> Widget<Message, Theme, Renderer> for SegmentedButton<'a, Variant, SelectionMode, Message>where
Self: SegmentedVariant,
Model<SelectionMode>: Selectable,
SelectionMode: Default,
Message: 'static + Clone,
impl<'a, Variant, SelectionMode, Message> Widget<Message, Theme, Renderer> for SegmentedButton<'a, Variant, SelectionMode, Message>where
Self: SegmentedVariant,
Model<SelectionMode>: Selectable,
SelectionMode: Default,
Message: 'static + Clone,
Source§fn on_event(
&mut self,
tree: &mut Tree,
event: Event,
layout: Layout<'_>,
cursor_position: Cursor,
_renderer: &Renderer,
_clipboard: &mut dyn Clipboard,
shell: &mut Shell<'_, Message>,
_viewport: &Rectangle,
) -> Status
fn on_event( &mut self, tree: &mut Tree, event: Event, layout: Layout<'_>, cursor_position: Cursor, _renderer: &Renderer, _clipboard: &mut dyn Clipboard, shell: &mut Shell<'_, Message>, _viewport: &Rectangle, ) -> Status
Source§fn operate(
&self,
tree: &mut Tree,
_layout: Layout<'_>,
_renderer: &Renderer,
operation: &mut dyn Operation<()>,
)
fn operate( &self, tree: &mut Tree, _layout: Layout<'_>, _renderer: &Renderer, operation: &mut dyn Operation<()>, )
Source§fn mouse_interaction(
&self,
tree: &Tree,
layout: Layout<'_>,
cursor_position: Cursor,
_viewport: &Rectangle,
_renderer: &Renderer,
) -> Interaction
fn mouse_interaction( &self, tree: &Tree, layout: Layout<'_>, cursor_position: Cursor, _viewport: &Rectangle, _renderer: &Renderer, ) -> Interaction
Source§fn draw(
&self,
tree: &Tree,
renderer: &mut Renderer,
theme: &Theme,
style: &Style,
layout: Layout<'_>,
cursor: Cursor,
viewport: &Rectangle,
)
fn draw( &self, tree: &Tree, renderer: &mut Renderer, theme: &Theme, style: &Style, layout: Layout<'_>, cursor: Cursor, viewport: &Rectangle, )
Widget
using the associated Renderer
.Source§fn overlay<'b>(
&'b mut self,
tree: &'b mut Tree,
layout: Layout<'_>,
_renderer: &Renderer,
translation: Vector,
) -> Option<Element<'b, Message, Theme, Renderer>>
fn overlay<'b>( &'b mut self, tree: &'b mut Tree, layout: Layout<'_>, _renderer: &Renderer, translation: Vector, ) -> Option<Element<'b, Message, Theme, Renderer>>
Widget
, if there is any.