mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-30 22:01:13 +00:00
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:
parent
a5ea6dd087
commit
e4bd6bbfb8
8 changed files with 180 additions and 104 deletions
|
@ -382,10 +382,10 @@ fn gen_backend_qt(root_dir: &Path, include_dir: &Path) -> anyhow::Result<()> {
|
|||
|
||||
config.export.include = items.iter().map(|x| x.to_string()).collect();
|
||||
|
||||
config
|
||||
.export
|
||||
.body
|
||||
.insert("NativeStyleMetrics".to_owned(), " inline NativeStyleMetrics();".to_owned());
|
||||
config.export.body.insert(
|
||||
"NativeStyleMetrics".to_owned(),
|
||||
" inline NativeStyleMetrics(); inline ~NativeStyleMetrics();".to_owned(),
|
||||
);
|
||||
|
||||
let mut crate_dir = root_dir.to_owned();
|
||||
crate_dir.extend(["sixtyfps_runtime", "rendering_backends", "qt"].iter());
|
||||
|
|
|
@ -732,7 +732,12 @@ cbindgen_private::Flickable::~Flickable()
|
|||
|
||||
cbindgen_private::NativeStyleMetrics::NativeStyleMetrics()
|
||||
{
|
||||
sixtyfps_init_native_style_metrics(this);
|
||||
sixtyfps_native_style_metrics_init(this);
|
||||
}
|
||||
|
||||
cbindgen_private::NativeStyleMetrics::~NativeStyleMetrics()
|
||||
{
|
||||
sixtyfps_native_style_metrics_deinit(this);
|
||||
}
|
||||
#endif // !defined(DOXYGEN)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue