pub struct SimpleComboRow<E: ToString> {
pub variants: Vec<E>,
pub active_index: Option<usize>,
}Expand description
A simple wrapper around adw::ComboRow.
This can be used with enums, Strings or any custom type you want.
The only requirement is that the inner type implements ToString and Debug.
To get notified when the selection changed, you can use
Connector::forward()
after launching the component.
Fields§
§variants: Vec<E>The variants that can be selected.
active_index: Option<usize>The index of the active element or None is nothing is selected.
Implementations§
Source§impl<E> SimpleComboRow<E>where
E: ToString,
impl<E> SimpleComboRow<E>where
E: ToString,
Sourcepub fn get_active_elem(&self) -> Option<&E>
pub fn get_active_elem(&self) -> Option<&E>
Return the value of the currently selected element or None if nothing is selected.
Trait Implementations§
Source§impl<E: Clone + ToString> Clone for SimpleComboRow<E>
impl<E: Clone + ToString> Clone for SimpleComboRow<E>
Source§fn clone(&self) -> SimpleComboRow<E>
fn clone(&self) -> SimpleComboRow<E>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<E> Component for SimpleComboRow<E>
impl<E> Component for SimpleComboRow<E>
Source§type CommandOutput = ()
type CommandOutput = ()
Messages which are received from commands executing in the background.
Source§type Input = SimpleComboRowMsg<E>
type Input = SimpleComboRowMsg<E>
The message type that the component accepts as inputs.
Source§type Init = SimpleComboRow<E>
type Init = SimpleComboRow<E>
The parameter used to initialize the component.
Source§fn init(
model: Self::Init,
widgets: Self::Root,
sender: ComponentSender<Self>,
) -> ComponentParts<Self>
fn init( model: Self::Init, widgets: Self::Root, sender: ComponentSender<Self>, ) -> ComponentParts<Self>
Creates the initial model and view, docking it into the component.
Source§fn update_with_view(
&mut self,
widgets: &mut Self::Widgets,
input: Self::Input,
sender: ComponentSender<Self>,
_root: &Self::Root,
)
fn update_with_view( &mut self, widgets: &mut Self::Widgets, input: Self::Input, sender: ComponentSender<Self>, _root: &Self::Root, )
Updates the model and view when a new input is received. Read more
Source§fn builder() -> ComponentBuilder<Self>
fn builder() -> ComponentBuilder<Self>
Create a builder for this component.
Source§fn update(
&mut self,
message: Self::Input,
sender: ComponentSender<Self>,
root: &Self::Root,
)
fn update( &mut self, message: Self::Input, sender: ComponentSender<Self>, root: &Self::Root, )
Processes inputs received by the component.
Source§fn update_cmd(
&mut self,
message: Self::CommandOutput,
sender: ComponentSender<Self>,
root: &Self::Root,
)
fn update_cmd( &mut self, message: Self::CommandOutput, sender: ComponentSender<Self>, root: &Self::Root, )
Defines how the component should respond to command updates.
Source§fn update_cmd_with_view(
&mut self,
widgets: &mut Self::Widgets,
message: Self::CommandOutput,
sender: ComponentSender<Self>,
root: &Self::Root,
)
fn update_cmd_with_view( &mut self, widgets: &mut Self::Widgets, message: Self::CommandOutput, sender: ComponentSender<Self>, root: &Self::Root, )
Updates the model and view upon completion of a command. Read more
Source§fn update_view(
&self,
widgets: &mut Self::Widgets,
sender: ComponentSender<Self>,
)
fn update_view( &self, widgets: &mut Self::Widgets, sender: ComponentSender<Self>, )
Updates the view after the model has been updated.
impl<E: Eq + ToString> Eq for SimpleComboRow<E>
impl<E: ToString> StructuralPartialEq for SimpleComboRow<E>
Auto Trait Implementations§
impl<E> Freeze for SimpleComboRow<E>
impl<E> RefUnwindSafe for SimpleComboRow<E>where
E: RefUnwindSafe,
impl<E> Send for SimpleComboRow<E>where
E: Send,
impl<E> Sync for SimpleComboRow<E>where
E: Sync,
impl<E> Unpin for SimpleComboRow<E>where
E: Unpin,
impl<E> UnwindSafe for SimpleComboRow<E>where
E: UnwindSafe,
Blanket Implementations§
Source§impl<C> AsyncPosition<()> for C
impl<C> AsyncPosition<()> for C
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.