mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Implemented check if running GUI application.
This commit is contained in:
parent
a3d37edbcf
commit
d86fb54b19
@ -18,10 +18,10 @@
|
|||||||
|
|
||||||
#include "RiuGuiTheme.h"
|
#include "RiuGuiTheme.h"
|
||||||
|
|
||||||
#include "RiuThemesDirectory.h"
|
#include "RiaApplication.h"
|
||||||
|
|
||||||
#include "RiaGuiApplication.h"
|
#include "RiaGuiApplication.h"
|
||||||
#include "RiaPreferences.h"
|
#include "RiaPreferences.h"
|
||||||
|
#include "RiuThemesDirectory.h"
|
||||||
#include "cafAppEnum.h"
|
#include "cafAppEnum.h"
|
||||||
|
|
||||||
#include <QAbstractItemModel>
|
#include <QAbstractItemModel>
|
||||||
@ -564,6 +564,8 @@ QAbstractItemModel* RiuGuiTheme::getQssCompletionModel( QCompleter* completer )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
QColor RiuGuiTheme::getColorByVariableName( const QString& variable, int theme /*= -1 */ )
|
QColor RiuGuiTheme::getColorByVariableName( const QString& variable, int theme /*= -1 */ )
|
||||||
{
|
{
|
||||||
|
if ( dynamic_cast<RiaGuiApplication*>( RiaApplication::instance() ) )
|
||||||
|
{
|
||||||
RiaDefines::ThemeEnum eTheme = RiaGuiApplication::instance()->preferences()->guiTheme();
|
RiaDefines::ThemeEnum eTheme = RiaGuiApplication::instance()->preferences()->guiTheme();
|
||||||
if ( theme >= 0 && theme < static_cast<int>( caf::AppEnum<RiaDefines::ThemeEnum>().size() ) )
|
if ( theme >= 0 && theme < static_cast<int>( caf::AppEnum<RiaDefines::ThemeEnum>().size() ) )
|
||||||
{
|
{
|
||||||
@ -574,6 +576,7 @@ QColor RiuGuiTheme::getColorByVariableName( const QString& variable, int theme /
|
|||||||
{
|
{
|
||||||
return QColor( s_variableValueMap[eTheme]["$" + variable] );
|
return QColor( s_variableValueMap[eTheme]["$" + variable] );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return Qt::black;
|
return Qt::black;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user