From 401c6ea4f66e84da45d0d2c50520a943f257f9a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Thu, 19 Dec 2024 10:43:46 -0300 Subject: [PATCH] Load user styles from style.css user config path if file exists (SpartanJ/ecode#370). --- src/tools/ecode/ecode.cpp | 7 +++++-- src/tools/ecode/ecode.hpp | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/tools/ecode/ecode.cpp b/src/tools/ecode/ecode.cpp index 7bc7174f8..e449bb6f6 100644 --- a/src/tools/ecode/ecode.cpp +++ b/src/tools/ecode/ecode.cpp @@ -3313,7 +3313,7 @@ bool App::needsRedirectToRunningProcess( std::string file ) { void App::init( const LogLevel& logLevel, std::string file, const Float& pidelDensity, const std::string& colorScheme, bool terminal, bool frameBuffer, bool benchmarkMode, - const std::string& css, bool health, const std::string& healthLang, + std::string css, bool health, const std::string& healthLang, FeaturesHealth::OutputFormat healthFormat, const std::string& fileToOpen, bool stdOutLogs, bool disableFileLogs, bool openClean, bool portable, std::string language ) { @@ -3608,7 +3608,10 @@ void App::init( const LogLevel& logLevel, std::string file, const Float& pidelDe setTheme( getThemePath() ); - if ( !css.empty() && FileSystem::fileExists( css ) ) { + if ( css.empty() ) + css = mConfigPath + "style.css"; + + if ( FileSystem::fileExists( css ) ) { CSS::StyleSheetParser parser; if ( parser.loadFromFile( css ) ) mUISceneNode->combineStyleSheet( parser.getStyleSheet(), false ); diff --git a/src/tools/ecode/ecode.hpp b/src/tools/ecode/ecode.hpp index 3d52e85d0..01904a2f1 100644 --- a/src/tools/ecode/ecode.hpp +++ b/src/tools/ecode/ecode.hpp @@ -43,7 +43,7 @@ class App : public UICodeEditorSplitter::Client { void init( const LogLevel& logLevel, std::string file, const Float& pidelDensity, const std::string& colorScheme, bool terminal, bool frameBuffer, bool benchmarkMode, - const std::string& css, bool health, const std::string& healthLang, + std::string css, bool health, const std::string& healthLang, ecode::FeaturesHealth::OutputFormat healthFormat, const std::string& fileToOpen, bool stdOutLogs, bool disableFileLogs, bool openClean, bool portable, std::string language );