From 23f581d7a0f708a98c2a696db403f78bc0e79b1e Mon Sep 17 00:00:00 2001 From: rubenthoms Date: Thu, 17 Sep 2020 16:35:39 +0200 Subject: [PATCH] Changed to defaulting to DEFAULT theme if not in GUI application. --- ApplicationCode/UserInterface/RiuGuiTheme.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/ApplicationCode/UserInterface/RiuGuiTheme.cpp b/ApplicationCode/UserInterface/RiuGuiTheme.cpp index 017e9f7274..a23a2f38dc 100644 --- a/ApplicationCode/UserInterface/RiuGuiTheme.cpp +++ b/ApplicationCode/UserInterface/RiuGuiTheme.cpp @@ -564,18 +564,19 @@ QAbstractItemModel* RiuGuiTheme::getQssCompletionModel( QCompleter* completer ) //-------------------------------------------------------------------------------------------------- QColor RiuGuiTheme::getColorByVariableName( const QString& variable, int theme /*= -1 */ ) { + RiaDefines::ThemeEnum eTheme = RiaDefines::ThemeEnum::DEFAULT; if ( dynamic_cast( RiaApplication::instance() ) ) { - RiaDefines::ThemeEnum eTheme = RiaGuiApplication::instance()->preferences()->guiTheme(); - if ( theme >= 0 && theme < static_cast( caf::AppEnum().size() ) ) - { - eTheme = static_cast( theme ); - } + eTheme = RiaGuiApplication::instance()->preferences()->guiTheme(); + } + if ( theme >= 0 && theme < static_cast( caf::AppEnum().size() ) ) + { + eTheme = static_cast( theme ); + } - if ( s_variableValueMap.keys().contains( eTheme ) && s_variableValueMap[eTheme].keys().contains( "$" + variable ) ) - { - return QColor( s_variableValueMap[eTheme]["$" + variable] ); - } + if ( s_variableValueMap.keys().contains( eTheme ) && s_variableValueMap[eTheme].keys().contains( "$" + variable ) ) + { + return QColor( s_variableValueMap[eTheme]["$" + variable] ); } return Qt::black; }