Skip to content

Commit

Permalink
Load user styles from style.css user config path if file exists (Spar…
Browse files Browse the repository at this point in the history
  • Loading branch information
SpartanJ committed Dec 19, 2024
1 parent 7e512c4 commit 401c6ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/tools/ecode/ecode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down Expand Up @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion src/tools/ecode/ecode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit 401c6ea

Please sign in to comment.