Cura: Themes question

Created on 22 Nov 2016  路  5Comments  路  Source: Ultimaker/Cura

What part of interface is styled using this themes :

https://github.com/Ultimaker/Cura/tree/master/resources/themes/cura
Is this used by main app window or by plugins too?

Second questions:

Are all of the interface widgets declared using QtQuick QML or some parts of interface is created in other way?

All 5 comments

The theme layer is used by all parts of Cura, including plugins. Note that almost everything in Cura is a plugin.

There are parts of Cura that use system styling. These are the parts that are not directly inside the main Cura window (ie: popups such as the preference panes).

AFAIK, all interface elements are declared using QML.

Thanks,

I also wonder how Cura knows which theme use (there is only one atm but still), there is no explicit mention of _/resources/themes/cura/styles.qml anywhere_ in the code or config file.

The other thing is QML does't have thing like Theme.getFont() or Theme.getColor() and such calls are mode from the styles.qml file. What's more its probably referencing the themes.json file which is next to styles.qml.

How it can be that i have access to Theme object within _styles.qml?_
I'm checkcing QtQuick docs and QML syntax but I can't find such object.

Cura is based on the Uranium framework, and the Theme layer is part of Uranium.
https://github.com/Ultimaker/Uranium

The QML Theme object can be found here:
https://github.com/Ultimaker/Uranium/blob/master/UM/Qt/Bindings/Theme.py
It is registered to QML here:
https://github.com/Ultimaker/Uranium/blob/master/UM/Qt/Bindings/Bindings.py#L83

Cura itself also registers a number of objects to QML, eg here:
https://github.com/Ultimaker/Cura/blob/master/cura/CuraApplication.py#L550

Unless a preference is set for which theme to use, Uranium looks for a theme with the same name as the application identifier (which is "cura" for the Cura application):
https://github.com/Ultimaker/Uranium/blob/master/UM/Qt/Bindings/Theme.py#L40

Was checking _http://ultimaker.github.io/Uranium/master/_ couldn't find it (beacuse it's not there) thanks!
If you can - please label this issua as question.

I have forfeited my labeling privileges...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dstulken picture dstulken  路  3Comments

Liger0 picture Liger0  路  3Comments

jornada812 picture jornada812  路  3Comments

Nemernemer picture Nemernemer  路  3Comments

DmitryBychkov picture DmitryBychkov  路  3Comments