improv(segmented-button): Documentation improvements with cosmic widget configurations
This commit is contained in:
parent
b13ad0b453
commit
5f9ff54352
5 changed files with 106 additions and 17 deletions
|
|
@ -1,8 +1,9 @@
|
|||
/// Copyright 2022 System76 <info@system76.com>
|
||||
// Copyright 2022 System76 <info@system76.com>
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
use iced_core::{Background, BorderRadius, Color};
|
||||
|
||||
/// The appearance of a [`SegmentedButton`].
|
||||
/// The appearance of a segmented button.
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct Appearance {
|
||||
pub background: Option<Background>,
|
||||
|
|
@ -14,7 +15,7 @@ pub struct Appearance {
|
|||
pub button_hover: ButtonAppearance,
|
||||
}
|
||||
|
||||
/// The appearance of a button in the [`SegmentedButton`]
|
||||
/// The appearance of a button in the segmented button
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct ButtonAppearance {
|
||||
pub background: Option<Background>,
|
||||
|
|
@ -25,11 +26,11 @@ pub struct ButtonAppearance {
|
|||
pub text_color: Color,
|
||||
}
|
||||
|
||||
/// Defines the [`Appearance`] of a [`SegmentedButton`].
|
||||
/// Defines the [`Appearance`] of a segmented button.
|
||||
pub trait StyleSheet {
|
||||
/// The supported style of the [`StyleSheet`].
|
||||
type Style: Default;
|
||||
|
||||
/// The [`Appearance`] of the [`SegmentedButton`].
|
||||
/// The [`Appearance`] of the segmented button.
|
||||
fn appearance(&self, style: &Self::Style) -> Appearance;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue