ferroui_controls/
theme_variant_scope.rs1use crate::{ControlImpl, Decorator};
2use ferroui_base::input::InputElementImpl;
3use ferroui_base::interactivity::InteractiveImpl;
4use ferroui_base::layout::LayoutableImpl;
5use ferroui_base::styling::ThemeVariant;
6use ferroui_base::{
7 ferro_class, ferro_class_info, ferro_impl_classes, instantiate, FerroObjectImpl, Ref, StyledElementImpl,
8 StyledProperty, VisualImpl,
9};
10
11#[repr(C)]
14pub struct ThemeVariantScope {
15 base: Decorator,
16}
17
18ferro_class!(ThemeVariantScope: Decorator);
19ferro_class_info!(ThemeVariantScope { new: ThemeVariantScope::new });
20ferro_impl_classes!(
21 ThemeVariantScope: FerroObjectImpl,
22 StyledElementImpl,
23 VisualImpl,
24 LayoutableImpl,
25 InteractiveImpl,
26 InputElementImpl,
27 ControlImpl
28);
29
30impl ThemeVariantScope {
31 pub fn actual_theme_variant_property() -> &'static StyledProperty<Option<ThemeVariant>> {
34 ThemeVariant::actual_theme_variant_property()
35 }
36
37 pub fn requested_theme_variant_property() -> &'static StyledProperty<Option<ThemeVariant>> {
40 ThemeVariant::requested_theme_variant_property()
41 }
42
43 pub fn construct() -> Self {
45 Self { base: Decorator::construct() }
46 }
47
48 pub fn new() -> Ref<Self> {
49 instantiate(Self::construct())
50 }
51
52 pub fn requested_theme_variant(&self) -> Option<ThemeVariant> {
59 self.get_value(Self::requested_theme_variant_property())
60 }
61
62 pub fn set_requested_theme_variant(&self, value: Option<ThemeVariant>) {
63 self.set_value(Self::requested_theme_variant_property(), value)
64 }
65}