How to implement (and use) custom themes for std-widgets.slint
?
#7232
-
Hi, I'm trying to use slint to develop application with my own design. In Qt/QML, we could change the outlook of QtQuick Controls by deriving QtQuick.Templates, then provide a style plugin as a library, I have developed a set of styled controls in my media player, and I want to do the same thing to styling I also tried write my widgets from scratch using basic elements, but I found Is there some way to implement themes like |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Additional: Maybe we could do the same thing? provide something like |
Beta Was this translation helpful? Give feedback.
-
The way this was designed is that one would adapt the include path so that "std-widgets.slint" point to your own. Regarding the ListView question, the ListView has special handling in the compiler so that at runtime, a special layout function is called: Line 959 in 87702e9 This works by just matching the name of the component to "ListView", so if you declare a component called ListView, it will have the same behavior (#861) |
Beta Was this translation helpful? Give feedback.
The way this was designed is that one would adapt the include path so that "std-widgets.slint" point to your own.
But in practice this is hardly possible because the styles now rely on some internal that might not even be accessible.
This is tracking in issue #45 , but we are currently not really working on that.
Regarding the ListView question, the ListView has special handling in the compiler so that at runtime, a special layout function is called:
slint/internal/core/model.rs
Line 959 in 87702e9
This works by just matching the name…