Added Settings -> Window -> UI Theme -> Syntax Color Scheme to use the editor color scheme globally for the UI Theme colors, having a single color palette for the whole UI and making much easier to style the UI, this solves SpartanJ/ecode#661, since now we support one UI theme for each existing syntax color scheme. Still a WIP, I'll continue improving it during the development of 0.7.5, but it's ready to use.

This commit is contained in:
Martín Lucas Golini
2026-01-18 01:38:27 -03:00
parent ddb412f42d
commit f180e58e56
22 changed files with 434 additions and 127 deletions

View File

@@ -2186,8 +2186,18 @@ UIMenu* SettingsMenu::createThemesMenu() {
->setOnShouldCloseCb( shouldCloseCb )
->setId( "default_theme" );
menu->addRadioButton( i18n( "syntax_color_scheme", "Syntax Color Scheme" ),
"syntax_color_scheme" == curTheme )
->setOnShouldCloseCb( shouldCloseCb )
->setTooltipText( i18n( "syntax_color_scheme_tool",
"Uses the editor color scheme colors to create a UI theme." ) )
->setId( "syntax_color_scheme" );
auto files = FileSystem::filesInfoGetInPath( mApp->getThemesPath(), true, true, true );
if ( !files.empty() )
menu->addSeparator();
for ( const auto& file : files ) {
if ( file.getExtension() != "css" )
continue;
@@ -2198,11 +2208,14 @@ UIMenu* SettingsMenu::createThemesMenu() {
}
menu->on( Event::OnItemClicked, [this]( const Event* event ) {
if ( event->getNode()->isType( UI_TYPE_MENU_SEPARATOR ) )
return;
auto id = event->getNode()->getId();
mApp->getConfig().ui.theme = "default_theme" != id ? id : "";
std::string path( mApp->getConfig().ui.theme.empty()
? mApp->getDefaultThemePath()
: mApp->getThemesPath() + id + ".css" );
std::string path(
mApp->getConfig().ui.theme.empty()
? mApp->getDefaultThemePath()
: ( "syntax_color_scheme" == id ? id : mApp->getThemesPath() + id + ".css" ) );
mApp->setTheme( path );
} );