feat(segmented-button): manually-definable icon colors
This commit is contained in:
parent
4fa61eeafd
commit
75e80857e2
5 changed files with 53 additions and 6 deletions
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
use std::borrow::Cow;
|
||||
|
||||
use iced::Color;
|
||||
use slotmap::{SecondaryMap, SparseSecondaryMap};
|
||||
|
||||
use crate::widget::IconSource;
|
||||
|
|
@ -94,6 +95,13 @@ where
|
|||
self
|
||||
}
|
||||
|
||||
/// Define the color for the icon.
|
||||
#[allow(clippy::must_use_candidate, clippy::return_self_not_must_use)]
|
||||
pub fn icon_color(self, icon: Option<Color>) -> Self {
|
||||
self.model.icon_color_set(self.id, icon);
|
||||
self
|
||||
}
|
||||
|
||||
/// Returns the ID of the item that was inserted.
|
||||
///
|
||||
/// ```ignore
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue