slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
17.55k stars 601 forks source link

Select the default style #83

Closed ogoffart closed 9 months ago

ogoffart commented 4 years ago

Currently the way to select the style is by setting the SLINT_STYLE environment variable while compiling (when running the slint-compiler)

We would like the native style to be the default on desktop, but only if Qt was found while compiling the runtime lib. But since we don't know that when running the compiler, the experience would be quite bad.

The native style require Qt, see https://github.com/slint-ui/slint/blob/master/docs/install_qt.md

Update: When using the rust integration or the interpreter, the default style is Qt if Qt was found

Update: some extra documentation in https://github.com/slint-ui/slint/blob/master/docs/widgets.md#selecting-a-widget-style

flukejones commented 3 years ago

Given that there are two main native styles (QT and GTK), will you be supporting GTK style at all?

ogoffart commented 3 years ago

Given that there are two main native styles (QT and GTK), will you be supporting GTK style at all?

In a GTK-based desktop environment, Qt itself is using the GTK style begind the scene. Using the Qt framework as an abstraction to draw native widget allow us to be looking native on every platform with less work for us at the moment. (This means we have SixtyFPS -> Qt -> GTK.)

Creating a GTK backend is totally possible, and we might consider doing that, but this is not a priority given that Qt provide a decent native look even in a GTK environment right now.

ogoffart commented 9 months ago

Closing this issue as there is not much to do anymore and this is documented in https://slint.dev/releases/1.3.2/docs/slint/src/advanced/style