Open-Typer
Open source typewriting tutor program
|
The ThemeEngine class provides theme functions. More...
#include "framework/ui/internal/ThemeEngine.h"
Public Member Functions | |
ThemeEngine () | |
void | init () |
QFont | font (void) override |
void | setFont (QFont newFont) override |
QString | fontFamily (void) override |
void | setFontFamily (QString family) override |
int | fontSize (void) override |
void | setFontSize (int size) override |
Q_INVOKABLE void | increaseFontSize (int delta) override |
Q_INVOKABLE int | maxFontSize (void) override |
Q_INVOKABLE bool | customExerciseTextColor (void) override |
QColor | exerciseTextColor (void) override |
void | setExerciseTextColor (QColor color) override |
Q_INVOKABLE void | resetExerciseTextColor (void) override |
Q_INVOKABLE QColor | defaultExerciseTextColor (void) override |
Q_INVOKABLE QColor | defaultExerciseTextColor (bool dark) override |
Q_INVOKABLE QColor | defaultExerciseTextColor (QColor accent) override |
Q_INVOKABLE QColor | defaultExerciseTextColor (QColor accent, bool dark) override |
Q_INVOKABLE bool | customInputTextColor (void) override |
QColor | inputTextColor (void) override |
void | setInputTextColor (QColor color) override |
Q_INVOKABLE void | resetInputTextColor (void) override |
Q_INVOKABLE QColor | defaultInputTextColor (bool dark=false) override |
Q_INVOKABLE bool | customBgColor (void) override |
QColor | bgColor (void) override |
void | setBgColor (QColor color) override |
Q_INVOKABLE void | resetBgColor (void) override |
Q_INVOKABLE QColor | defaultBgColor (bool dark=false) override |
Q_INVOKABLE bool | customPaperColor (void) override |
QColor | paperColor (void) override |
void | setPaperColor (QColor color) override |
Q_INVOKABLE void | resetPaperColor (void) override |
Q_INVOKABLE QColor | defaultPaperColor (bool dark=false) override |
Q_INVOKABLE bool | customPanelColor (void) override |
QColor | panelColor (void) override |
void | setPanelColor (QColor color) override |
Q_INVOKABLE void | resetPanelColor (void) override |
Q_INVOKABLE QColor | defaultPanelColor (bool dark=false) override |
AccentColor | accentColor (void) override |
void | setAccentColor (AccentColor color) override |
Q_INVOKABLE QColor | getAccentColor (AccentColor colorId) override |
QColor | currentAccentColor (void) override |
Theme | theme (void) const override |
void | setTheme (ThemeEngine::Theme newTheme) override |
Q_INVOKABLE void | updateTheme (void) override |
Q_INVOKABLE void | setDefaultTheme (void) override |
QColor | borderColor () const override |
QColor | foregroundColor () const override |
Static Public Member Functions | |
static std::shared_ptr< ThemeEngine > | instance () |
Properties | |
QFont | font |
QString | fontFamily |
int | fontSize |
QColor | exerciseTextColor |
QColor | inputTextColor |
QColor | bgColor |
QColor | paperColor |
QColor | panelColor |
AccentColor | accentColor |
QColor | currentAccentColor |
QColor | borderColor |
QColor | foregroundColor |
Theme | theme |
Private Member Functions | |
void | updateStyleSheet () |
void | applyStyleSheetFromFile (const QString &stylePath) |
Static Private Attributes | |
static std::shared_ptr< ThemeEngine > | m_instance = std::make_shared<ThemeEngine>() |
Additional Inherited Members | |
Public Types inherited from IThemeEngine | |
enum | AccentColor { Accent_Red = 0 , Accent_Orange = 1 , Accent_Yellow = 2 , Accent_Green = 3 , Accent_LightBlue = 4 , Accent_Purple = 5 , Accent_Pink = 6 } |
enum class | Theme { LightTheme = 1 , DarkTheme = 0 } |
Signals inherited from IThemeEngine | |
void | fontChanged () |
void | fontFamilyChanged () |
void | fontSizeChanged () |
void | colorChanged () |
void | exerciseTextColorChanged () |
void | inputTextColorChanged () |
void | bgColorChanged () |
void | paperColorChanged () |
void | panelColorChanged () |
void | accentColorChanged () |
void | currentAccentColorChanged () |
void | themeChanged () |
void | borderColorChanged () |
void | foregroundColorChanged () |
The ThemeEngine class provides theme functions.
ThemeEngine::ThemeEngine | ( | ) |
Constructs ThemeEngine.
|
overridevirtual |
Implements IThemeEngine.
|
overridevirtual |
Implements IThemeEngine.
|
overridevirtual |
Implements IThemeEngine.
|
overridevirtual |
Implements IThemeEngine.
|
overridevirtual |
Returns true if there's a custom background color set.
Implements IThemeEngine.
|
overridevirtual |
Returns true if there's a custom exercise text color set.
Implements IThemeEngine.
|
overridevirtual |
Returns true if there's a custom input text color set.
Implements IThemeEngine.
|
overridevirtual |
Returns true if there's a custom panel color set.
Implements IThemeEngine.
|
overridevirtual |
Returns true if there's a custom paper color set.
Implements IThemeEngine.
|
overridevirtual |
Returns default background color.
Implements IThemeEngine.
|
overridevirtual |
Returns default exercise text color for light or dark theme.
Implements IThemeEngine.
|
overridevirtual |
Returns default exercise text color for the given accent color.
Implements IThemeEngine.
|
overridevirtual |
Returns default exercise text color for the given accent color and light or dark theme.
Implements IThemeEngine.
|
overridevirtual |
Returns default exercise text color.
Implements IThemeEngine.
|
overridevirtual |
Returns default input text color.
Implements IThemeEngine.
|
overridevirtual |
Returns default panel color.
Implements IThemeEngine.
|
overridevirtual |
Returns default paper color.
Implements IThemeEngine.
|
overridevirtual |
Implements IThemeEngine.
|
overridevirtual |
Implements IThemeEngine.
|
overridevirtual |
Implements IThemeEngine.
|
overridevirtual |
Implements IThemeEngine.
|
overridevirtual |
Implements IThemeEngine.
|
overridevirtual |
Returns the accent color of the given ID.
Implements IThemeEngine.
|
overridevirtual |
Increases (or decreases) font point size.
Implements IThemeEngine.
void ThemeEngine::init | ( | ) |
Initializes the ThemeEngine.
|
overridevirtual |
Implements IThemeEngine.
|
static |
Returns the static instance of ThemeEngine.
|
overridevirtual |
Returns maximum font point size.
Implements IThemeEngine.
|
overridevirtual |
Implements IThemeEngine.
|
overridevirtual |
Implements IThemeEngine.
|
overridevirtual |
Resets background color.
Implements IThemeEngine.
|
overridevirtual |
Resets exercise text color.
Implements IThemeEngine.
|
overridevirtual |
Resets input text color.
Implements IThemeEngine.
|
overridevirtual |
Resets panel color.
Implements IThemeEngine.
|
overridevirtual |
Resets paper color.
Implements IThemeEngine.
|
overridevirtual |
Implements IThemeEngine.
|
overridevirtual |
Implements IThemeEngine.
|
overridevirtual |
Sets theme based on system theme.
Implements IThemeEngine.
|
overridevirtual |
Implements IThemeEngine.
|
overridevirtual |
Implements IThemeEngine.
|
overridevirtual |
Implements IThemeEngine.
|
overridevirtual |
Implements IThemeEngine.
|
overridevirtual |
Implements IThemeEngine.
|
overridevirtual |
Implements IThemeEngine.
|
overridevirtual |
Implements IThemeEngine.
|
overridevirtual |
Implements IThemeEngine.
|
overridevirtual |
Implements IThemeEngine.
|
overridevirtual |
Loads and sets application style.
Implements IThemeEngine.
|
readwrite |
Current accent color ID.
|
readwrite |
Background color.
|
read |
Current accent color.
|
readwrite |
Exercise text color.
|
readwrite |
The selected font.
Note: Font style such as bold, italic or underlined is not supported.
|
readwrite |
Font family of the selected font.
|
readwrite |
Point size of the selected font.
|
readwrite |
Input text color.
|
readwrite |
Panel color.
|
readwrite |
Paper color.
|
readwrite |
Current application theme.