Closed qarmin closed 1 year ago
Hi,
it should be StyleMetrics
, because NativeStyleMetrics
is only used internal. Maybe that causes the trouble.
import { StyleMetrics } from "std-widgets.slint";
export component MyComponent }
in property <bool> is-dark: StyleMetrics.dark-color-scheme;
}
Two hints to StyleMetrics
. It's not official now and api changes are possible. The dark-color-scheme property cannot be change from outside.
Thanks for the bug report. As FloVanGH already mentioned, NativeStyleMetrics is completely internal and shouldn't be used. The bug here is that it is not an error in the Slint compiler. NativeStyleMEtrics shouldn't be exposed. (And you get undefined error later because it is only enabled when the qt backend is available)
Edit: NativeStyleMetrics is marked as
is_internal
, and yet it can be looked up in user code. There is a check that we don't lookup internal elements, but that check is not active for globals.Original description
Slint 1.3.0 - 3deb620953f1307de1b9c0b5b757b5d8ed31a3a1
When trying to preview
left_side_panel.slint
project file in VScode I got this crashCompilation also fails
Changes that caused problem - https://github.com/qarmin/czkawka/commit/f128dd6a881fa58fd3000762d8f8844222cf3100
I started to use global NativeStyleMetrics to get info if it is dark mode or not