Do the apply_default_properties_from_style before the lower_states pass

because we don't want the lowered state property to look like we set a property on it.

Also do the ensure_window before because it need to be done before to be assigned
the default color
This commit is contained in:
Olivier Goffart 2021-11-04 09:27:00 +01:00
parent 90a97cd737
commit f316c38d54
3 changed files with 25 additions and 17 deletions

View file

@ -18,7 +18,11 @@ use std::collections::HashSet;
use std::rc::Rc;
pub fn ensure_window(component: &Rc<Component>, type_register: &TypeRegister) {
if matches!(component.root_element.borrow().base_type.to_string().as_str(), "Window" | "Dialog")
if component
.root_element
.borrow()
.builtin_type()
.map_or(true, |b| matches!(b.name.as_str(), "Window" | "Dialog"))
{
return; // already a window, nothing to do
}