summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/themeinterface.h
AgeCommit message (Collapse)Author
2021-01-19mobile/UI: remember the system default font sizeGravatar Dirk Hohndel
We need to do this before the preferences are loaded, or the system default size is lost. Given that our other sizes are all relative to this value, that would be a problem. With this we can now ensure that we always have the right font size for smaller, regular, and larger theme settings. Also removes some obsolete commented out code. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-30cleanup: fold ThemeInterface::setup() into constructorGravatar Berthold Stoeger
There appears to be no reason for two-phase initialization. Let's keep things simple: let the constructor produce a functioning object. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-30cleanup: don't send values in changed-signals of ThemeInterfaceGravatar Berthold Stoeger
According to the Qt-docs you *may* send the new values in the NOTIFY signal of Q_PROPERTYs. However, since changes will lead to a reevaluation of a whole expression, this argument will be unused. All it does is make the code more verbose and brittle: What happens if you send the wrong value? Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-30coding style: rename themeInterface to ThemeInterfaceGravatar Berthold Stoeger
As per coding style, class names are PascalCase. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-30cleanup: make members of ThemeInterface non-staticGravatar Berthold Stoeger
We have a singleton class ThemeInterface, which means that it is global and exists only once. It's members are static, i.e. also global. A message from the department of redundancy department? In any case, that makes no sense. Let's just make these members local to the class. I would even rip out the whole singleton thing, since the object is not accessed anywhere outside from QML. Let's keep it for now. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-21mobile UI: stop the use of dark icon themeGravatar Dirk Hohndel
This was used very inconsistently and had more bugs than positive impact. See #2686 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-03mobile-widgets/themeinterface: make most part staticGravatar jan Iversen
Make variables and functions static where possible, this is done to prevent different versions of theme with different values. Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-30mobile-widgets: emit signals for each colorGravatar jan Iversen
Emit signals for each standard color when theme changes. The iconStyle property was changed from being a constant, because it can change, and thus a signal was added. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-30mobile-widgets: move font property to themeInterfaceGravatar jan Iversen
Move setting of font properties used throughout to themeInterface. Add new settings "currentScale". The properties are kept in main (subsurfaceTheme) in order not to do a big search/replace. Update settings to use currectScale and signal changes in themeinterface. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-30mobile-widgets: move basePointSize to themeinterfaceGravatar jan Iversen
Check defaultfont and calculate basepointsize in themeinterface instead of in QML. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-28themeinterface: move registration to themeinterfaceGravatar jan Iversen
Move setup call and registration from subsurface-helper to themeInterface, in order to keep the registration where the code are. Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-26mobile-widgets: add themeInterfaceGravatar jan Iversen
Currently subsurfaceTheme resides in main.qml, where it does not naturally belong. Add C++ class that will replace subsurfaceTheme in main.qml in a 1-1 manner. This opens future posibilities - on top of the 3 themes, allow users to select colors/fonts - add stylesheets to Template* components - make day/night shift automatically. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>