// Copyright 2022 System76 // SPDX-License-Identifier: MPL-2.0 use std::borrow::Cow; use crate::{widget::text, Element, Renderer}; use iced::widget::{horizontal_space, row, Row}; /// A setting within a settings view section. #[must_use] #[allow(clippy::module_name_repetitions)] pub fn item<'a, Message: 'static>( title: impl Into>, widget: impl Into>, ) -> Row<'a, Message, Renderer> { item_row(vec![ text(title).into(), horizontal_space(iced::Length::Fill).into(), widget.into(), ]) } /// A settings item aligned in a row #[must_use] #[allow(clippy::module_name_repetitions)] pub fn item_row(children: Vec>) -> Row { row(children) .align_items(iced::Alignment::Center) .padding([0, 18]) .spacing(12) }