// Copyright 2022 System76 // SPDX-License-Identifier: MPL-2.0 use super::{SegmentedButton, State}; use iced_core::Length; /// Appears as a collection of tabs for developing a tabbed interface. /// /// The data for the widget comes from a [`State`] that is maintained the application. #[must_use] pub fn view_switcher( state: &State, ) -> SegmentedButton { SegmentedButton::new(&state.inner) .height(Length::Units(48)) .style(crate::theme::SegmentedButton::ViewSwitcher) .font_active(crate::font::FONT_SEMIBOLD) } /// Appears as a selection of choices for choosing between. /// /// The data for the widget comes from a [`State`] that is maintained the application. #[must_use] pub fn segmented_selection( state: &State, ) -> SegmentedButton { SegmentedButton::new(&state.inner) .height(Length::Units(32)) .style(crate::theme::SegmentedButton::Selection) .font_active(crate::font::FONT_SEMIBOLD) }