mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-02 06:41:14 +00:00
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:
parent
90a97cd737
commit
f316c38d54
3 changed files with 25 additions and 17 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue