From e5c682934668c029ac01700465787e49d772425b Mon Sep 17 00:00:00 2001 From: pml68 Date: Thu, 17 Apr 2025 00:30:18 +0200 Subject: feat(material_theme): implement `combo_box::Catalog` --- crates/material_theme/src/combo_box.rs | 5 +++++ crates/material_theme/src/lib.rs | 1 + crates/material_theme/src/menu.rs | 7 ++----- crates/material_theme/src/pick_list.rs | 7 ++----- 4 files changed, 10 insertions(+), 10 deletions(-) create mode 100644 crates/material_theme/src/combo_box.rs (limited to 'crates/material_theme') diff --git a/crates/material_theme/src/combo_box.rs b/crates/material_theme/src/combo_box.rs new file mode 100644 index 0000000..3024176 --- /dev/null +++ b/crates/material_theme/src/combo_box.rs @@ -0,0 +1,5 @@ +use iced_widget::combo_box::Catalog; + +use super::Theme; + +impl Catalog for Theme {} diff --git a/crates/material_theme/src/lib.rs b/crates/material_theme/src/lib.rs index 06ad838..64e71d3 100644 --- a/crates/material_theme/src/lib.rs +++ b/crates/material_theme/src/lib.rs @@ -6,6 +6,7 @@ use serde::Deserialize; pub mod button; pub mod checkbox; +pub mod combo_box; pub mod container; #[cfg(feature = "dialog")] pub mod dialog; diff --git a/crates/material_theme/src/menu.rs b/crates/material_theme/src/menu.rs index 5990c00..9f43c72 100644 --- a/crates/material_theme/src/menu.rs +++ b/crates/material_theme/src/menu.rs @@ -1,4 +1,4 @@ -use iced_widget::core::{Background, Border, border}; +use iced_widget::core::{Background, border}; use iced_widget::overlay::menu::{Catalog, Style, StyleFn}; use super::Theme; @@ -20,10 +20,7 @@ pub fn default(theme: &Theme) -> Style { let colors = theme.colorscheme.surface; Style { - border: Border { - radius: border::bottom(4), - ..Default::default() - }, + border: border::rounded(4), background: Background::Color(colors.surface_container.base), text_color: colors.on_surface, selected_background: Background::Color(mix( diff --git a/crates/material_theme/src/pick_list.rs b/crates/material_theme/src/pick_list.rs index 25b09f8..4b34871 100644 --- a/crates/material_theme/src/pick_list.rs +++ b/crates/material_theme/src/pick_list.rs @@ -1,4 +1,4 @@ -use iced_widget::core::{Background, Border, border}; +use iced_widget::core::{Background, border}; use iced_widget::pick_list::{Catalog, Status, Style, StyleFn}; use super::Theme; @@ -38,10 +38,7 @@ pub fn default(theme: &Theme, status: Status) -> Style { }, Status::Opened { .. } => Style { background: Background::Color(surface.surface_container.highest), - border: Border { - radius: border::top(4), - ..Default::default() - }, + border: border::rounded(4), ..active }, } -- cgit v1.2.3