Make defaults of composite widgets configurable

This commit is contained in:
Héctor Ramón Jiménez 2024-03-25 22:12:47 +01:00
parent f0ae9a0c38
commit 74373cb086
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
3 changed files with 35 additions and 15 deletions

View file

@ -84,7 +84,7 @@ where
font: None,
handle: Handle::default(),
class: <Theme as Catalog>::default(),
menu_class: <Theme as menu::Catalog>::default(),
menu_class: <Theme as Catalog>::default_menu(),
}
}
@ -700,6 +700,11 @@ pub trait Catalog: menu::Catalog {
/// The default class produced by the [`Catalog`].
fn default<'a>() -> <Self as Catalog>::Class<'a>;
/// The default class for the menu of the [`PickList`].
fn default_menu<'a>() -> <Self as menu::Catalog>::Class<'a> {
<Self as menu::Catalog>::default()
}
/// The [`Style`] of a class with the given status.
fn style(
&self,