feat(segmented-button): manually-definable icon colors

This commit is contained in:
Michael Aaron Murphy 2023-02-13 16:09:05 +01:00 committed by Jeremy Soller
parent 4fa61eeafd
commit 75e80857e2
5 changed files with 53 additions and 6 deletions

View file

@ -1,6 +1,7 @@
// Copyright 2023 System76 <info@system76.com>
// SPDX-License-Identifier: MPL-2.0
use iced::Color;
use slotmap::{SecondaryMap, SparseSecondaryMap};
use super::{Entity, Model, Selectable};
@ -108,6 +109,13 @@ where
self
}
/// Defines the color of an icon.
#[allow(clippy::must_use_candidate, clippy::return_self_not_must_use)]
pub fn icon_color(mut self, icon: Option<Color>) -> Self {
self.model.0.icon_color_set(self.id, icon);
self
}
/// Define the position of the newly-inserted item.
#[allow(clippy::must_use_candidate, clippy::return_self_not_must_use)]
pub fn position(mut self, position: u16) -> Self {