Commit 6b3ea3d
committed
Fix font familly of component that inherit from PopupWindow with the material style
Fixes slint-ui#9866
The material style defines a `StyleMetrics.default-font-family` which is
meant to be applied to `Window` element if not set by the user.
But it was mistakely sometimes applied to PopupWindow
Consider this code:
```slint
component MyPopup inherits PopupWindow {
Text { text: "Hello"; }
}
export component MainWindow inherits Window {
my_popup := MyPopup { }
}
```
First, we would process MyPopup: `apply_default_property_from_style`
wouldn't do anything, but the `lower_popups` pass would replace its
root with a Window builtin.
Second, we would process MainWindow: `apply_default_property_from_style`
would see that my_popup is using the Window as a builtin and would apply
default window properties from style, which it shouldn't.
In fact, `apply_default_property_from_style` should only apply default
for elements that are directly using the builtin, not a component that
inherits from that builtin, as these property should have been already
set.1 parent ce4283e commit 6b3ea3d
File tree
1 file changed
+4
-2
lines changed- internal/compiler/passes
1 file changed
+4
-2
lines changedLines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| |||
0 commit comments