Serial Studio 1.1.6
A dashboard software for your embedded projects
|
The ThemeManager class. More...
#include <ThemeManager.h>
Public Slots | |
void | setTheme (const int id) |
void | setCustomWindowDecorations (const bool enabled) |
Signals | |
void | themeChanged () |
void | availableThemesChanged () |
void | customWindowDecorationsChanged () |
Public Member Functions | |
int | themeId () const |
bool | customWindowDecorations () const |
bool | titlebarSeparator () const |
QColor | base () const |
QColor | link () const |
QColor | button () const |
QColor | window () const |
QColor | text () const |
QColor | border () const |
QColor | midlight () const |
QColor | highlight () const |
QColor | brightText () const |
QColor | buttonText () const |
QColor | windowText () const |
QColor | tooltipText () const |
QColor | tooltipBase () const |
QColor | highlightedText () const |
QColor | highlightedTextAlternative () const |
QColor | placeholderText () const |
QColor | toolbarGradient1 () const |
QColor | toolbarGradient2 () const |
QColor | menubarText () const |
QColor | dialogBackground () const |
QColor | consoleText () const |
QColor | consoleBase () const |
QColor | consoleButton () const |
QColor | consoleWindow () const |
QColor | consoleHighlight () const |
QColor | consoleHighlightedText () const |
QColor | consolePlaceholderText () const |
QColor | windowBackground () const |
QColor | windowGradient1 () const |
QColor | windowGradient2 () const |
QColor | alternativeHighlight () const |
QColor | setupPanelBackground () const |
QColor | widgetTextPrimary () const |
QColor | widgetTextSecondary () const |
QColor | widgetWindowBackground () const |
QColor | widgetWindowBorder () const |
QColor | paneWindowBackground () const |
QColor | ledEnabled () const |
QColor | ledDisabled () const |
QColor | csvCheckbox () const |
QColor | widgetForegroundPrimary () const |
QColor | widgetForegroundSecondary () const |
QColor | widgetIndicator () const |
QColor | widgetControlBackground () const |
QColor | connectButtonChecked () const |
QColor | connectButtonUnchecked () const |
QColor | mqttButton () const |
StringList | widgetColors () const |
StringList | availableThemes () const |
Static Public Member Functions | |
static ThemeManager & | instance () |
Private Slots | |
void | populateThemes () |
void | loadTheme (const int id) |
Private Member Functions | |
ThemeManager () | |
ThemeManager (ThemeManager &&)=delete | |
ThemeManager (const ThemeManager &)=delete | |
ThemeManager & | operator= (ThemeManager &&)=delete |
ThemeManager & | operator= (const ThemeManager &)=delete |
The ThemeManager class.
The ThemeManager
class reads all the colors that are required to build a Serial Studio theme and makes them available to the rest of the application.
Themes are stored as JSON files in the "assets/themes" folder. The class automatically builds a model with the available themes. The only requirement to create your own themes is to create a JSON theme file and add it to the application resources file.
|
explicitprivate |
Constructor function, searches for available themes & loads the theme variant selected by the user.
|
privatedelete |
|
privatedelete |
QColor Misc::ThemeManager::alternativeHighlight | ( | ) | const |
StringList Misc::ThemeManager::availableThemes | ( | ) | const |
|
signal |
QColor Misc::ThemeManager::base | ( | ) | const |
QColor Misc::ThemeManager::border | ( | ) | const |
QColor Misc::ThemeManager::brightText | ( | ) | const |
QColor Misc::ThemeManager::button | ( | ) | const |
QColor Misc::ThemeManager::buttonText | ( | ) | const |
QColor Misc::ThemeManager::connectButtonChecked | ( | ) | const |
QColor Misc::ThemeManager::connectButtonUnchecked | ( | ) | const |
QColor Misc::ThemeManager::consoleBase | ( | ) | const |
QColor Misc::ThemeManager::consoleButton | ( | ) | const |
QColor Misc::ThemeManager::consoleHighlight | ( | ) | const |
QColor Misc::ThemeManager::consoleHighlightedText | ( | ) | const |
QColor Misc::ThemeManager::consolePlaceholderText | ( | ) | const |
QColor Misc::ThemeManager::consoleText | ( | ) | const |
QColor Misc::ThemeManager::consoleWindow | ( | ) | const |
QColor Misc::ThemeManager::csvCheckbox | ( | ) | const |
bool Misc::ThemeManager::customWindowDecorations | ( | ) | const |
Returns true
if the application should draw the window decorations & controls by itself. This feature makes it look cooler, but it can lead to some trouble on not-so-common desktop environments, such as CDE.
|
signal |
QColor Misc::ThemeManager::dialogBackground | ( | ) | const |
QColor Misc::ThemeManager::highlight | ( | ) | const |
QColor Misc::ThemeManager::highlightedText | ( | ) | const |
QColor Misc::ThemeManager::highlightedTextAlternative | ( | ) | const |
|
static |
Returns a pointer to the only instance of this class
QColor Misc::ThemeManager::ledDisabled | ( | ) | const |
QColor Misc::ThemeManager::ledEnabled | ( | ) | const |
QColor Misc::ThemeManager::link | ( | ) | const |
|
privateslot |
QColor Misc::ThemeManager::menubarText | ( | ) | const |
QColor Misc::ThemeManager::midlight | ( | ) | const |
QColor Misc::ThemeManager::mqttButton | ( | ) | const |
|
privatedelete |
|
privatedelete |
QColor Misc::ThemeManager::paneWindowBackground | ( | ) | const |
QColor Misc::ThemeManager::placeholderText | ( | ) | const |
|
privateslot |
Reads all the available theme files from the application resources folder.
|
slot |
Enables/disables the custom window feature. See the customWindowDecorations()
function for more information.
|
slot |
Updates the theme ID to be used & saves the changes to the application settings.
Finally, this function prompts the user to restart the application in order to apply changes.
Unfortunately, an app restart is required because the application palette must be set before the GUI is initialized.
QColor Misc::ThemeManager::setupPanelBackground | ( | ) | const |
QColor Misc::ThemeManager::text | ( | ) | const |
|
signal |
int Misc::ThemeManager::themeId | ( | ) | const |
Returns the ID of the theme that the user has selected.
bool Misc::ThemeManager::titlebarSeparator | ( | ) | const |
QColor Misc::ThemeManager::toolbarGradient1 | ( | ) | const |
QColor Misc::ThemeManager::toolbarGradient2 | ( | ) | const |
QColor Misc::ThemeManager::tooltipBase | ( | ) | const |
QColor Misc::ThemeManager::tooltipText | ( | ) | const |
StringList Misc::ThemeManager::widgetColors | ( | ) | const |
QColor Misc::ThemeManager::widgetControlBackground | ( | ) | const |
QColor Misc::ThemeManager::widgetForegroundPrimary | ( | ) | const |
QColor Misc::ThemeManager::widgetForegroundSecondary | ( | ) | const |
QColor Misc::ThemeManager::widgetIndicator | ( | ) | const |
QColor Misc::ThemeManager::widgetTextPrimary | ( | ) | const |
QColor Misc::ThemeManager::widgetTextSecondary | ( | ) | const |
QColor Misc::ThemeManager::widgetWindowBackground | ( | ) | const |
QColor Misc::ThemeManager::widgetWindowBorder | ( | ) | const |
QColor Misc::ThemeManager::window | ( | ) | const |
QColor Misc::ThemeManager::windowBackground | ( | ) | const |
QColor Misc::ThemeManager::windowGradient1 | ( | ) | const |
QColor Misc::ThemeManager::windowGradient2 | ( | ) | const |
QColor Misc::ThemeManager::windowText | ( | ) | const |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
readwrite |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |
|
read |