feat(widget): add dropdown widget as pick_list replacement
The Dropdown widget is based on the PickList widget from iced.
This commit is contained in:
parent
dbd6c978ba
commit
ca7c17ce21
9 changed files with 1121 additions and 15 deletions
38
src/widget/dropdown/menu/appearance.rs
Normal file
38
src/widget/dropdown/menu/appearance.rs
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
// Copyright 2023 System76 <info@system76.com>
|
||||
// Copyright 2019 Héctor Ramón, Iced contributors
|
||||
// SPDX-License-Identifier: MPL-2.0 AND MIT
|
||||
|
||||
//! Change the appearance of menus.
|
||||
use iced_core::{Background, BorderRadius, Color};
|
||||
|
||||
/// The appearance of a menu.
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub struct Appearance {
|
||||
/// Menu text color
|
||||
pub text_color: Color,
|
||||
/// Menu background
|
||||
pub background: Background,
|
||||
/// Menu border width
|
||||
pub border_width: f32,
|
||||
/// Menu border radius
|
||||
pub border_radius: BorderRadius,
|
||||
/// Menu border color
|
||||
pub border_color: Color,
|
||||
/// Text color when hovered
|
||||
pub hovered_text_color: Color,
|
||||
/// Background when hovered
|
||||
pub hovered_background: Background,
|
||||
/// Text color when selected
|
||||
pub selected_text_color: Color,
|
||||
/// Background when selected
|
||||
pub selected_background: Background,
|
||||
}
|
||||
|
||||
/// The style sheet of a menu.
|
||||
pub trait StyleSheet {
|
||||
/// The supported style of the [`StyleSheet`].
|
||||
type Style: Default + Clone;
|
||||
|
||||
/// Produces the [`Appearance`] of a menu.
|
||||
fn appearance(&self, style: &Self::Style) -> Appearance;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue