Native style: respond to the StyleChange event

So that color scheme is updated when switching to the dark style, for example

Fixes #687
This commit is contained in:
Olivier Goffart 2021-11-26 11:13:59 +01:00 committed by Olivier Goffart
parent a5ea6dd087
commit e4bd6bbfb8
8 changed files with 180 additions and 104 deletions

View file

@ -14,6 +14,7 @@ LICENSE END */
pub type FieldOffset<T, U> = const_field_offset::FieldOffset<T, U, const_field_offset::AllowPin>;
use crate::items::PropertyAnimation;
use alloc::rc::Rc;
use core::convert::{TryFrom, TryInto};
use core::pin::Pin;
@ -332,3 +333,8 @@ pub trait BuiltinItem: Sized {
fn fields<Value: ValueType>() -> Vec<(&'static str, &'static dyn FieldInfo<Self, Value>)>;
fn callbacks<Value: ValueType>() -> Vec<(&'static str, &'static dyn CallbackInfo<Self, Value>)>;
}
/// Trait implemented by builtin globals
pub trait BuiltinGlobal: BuiltinItem {
fn new() -> Pin<Rc<Self>>;
}