feat: MultiSelect support for segmented buttons

This commit is contained in:
Michael Aaron Murphy 2023-01-06 16:18:25 +01:00 committed by Michael Murphy
parent b1cbcfaf5b
commit 8988b25b6a
9 changed files with 263 additions and 112 deletions

View file

@ -10,11 +10,11 @@ use iced_core::Color;
use crate::{theme, Theme};
use super::segmented_button::{self, cosmic::vertical_view_switcher};
use super::segmented_button::{self, cosmic::vertical_view_switcher, SingleSelect};
/// A container holding a vertical view switcher with the n style
pub fn nav_bar<Data, Message>(
state: &segmented_button::State<Data>,
state: &segmented_button::State<SingleSelect, Data>,
on_activate: impl Fn(segmented_button::Key) -> Message + 'static,
) -> iced::widget::Container<Message, crate::Renderer>
where
@ -26,7 +26,7 @@ where
.button_padding([16, 10, 16, 10])
.button_spacing(8)
.icon_size(16)
.spacing(14)
.spacing(8)
.apply(scrollable)
.apply(container)
.height(Length::Fill)