refactor!: separate horizontal and vertical segmented button widgets
- Removes the orientation enum in favor of two separate widgets - Implements the spacing attribute for both widgets - Demo is updated to display spaced variants of the widgets
This commit is contained in:
parent
3af1da6332
commit
444e389496
12 changed files with 969 additions and 547 deletions
|
|
@ -1,7 +1,6 @@
|
|||
// Copyright 2022 System76 <info@system76.com>
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
use crate::widget::Orientation;
|
||||
use iced_core::{Background, BorderRadius, Color};
|
||||
|
||||
/// The appearance of a segmented button.
|
||||
|
|
@ -32,6 +31,9 @@ pub trait StyleSheet {
|
|||
/// The supported style of the [`StyleSheet`].
|
||||
type Style: Default;
|
||||
|
||||
/// The [`Appearance`] of the segmented button.
|
||||
fn appearance(&self, style: &Self::Style, orientation: Orientation) -> Appearance;
|
||||
/// The horizontal [`Appearance`] of the segmented button.
|
||||
fn horizontal(&self, style: &Self::Style) -> Appearance;
|
||||
|
||||
/// The vertical [`Appearance`] of the segmented button.
|
||||
fn vertical(&self, style: &Self::Style) -> Appearance;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue