IntelliJ Themes: added more popular open-source IntelliJ themes to demo

(downloaded latest .theme.json from source repos;
see themes.properties for source repo URLs)
This commit is contained in:
Karl Tauber
2019-11-21 13:17:06 +01:00
parent e6e19110b2
commit 6d86cf8f9c
38 changed files with 26917 additions and 8 deletions

View File

@@ -36,9 +36,4 @@ class IJThemeInfo
this.themeFile = themeFile;
this.lafClassName = lafClassName;
}
@Override
public String toString() {
return name;
}
}

View File

@@ -69,7 +69,12 @@ public class IJThemesPanel
int index, boolean isSelected, boolean cellHasFocus )
{
String title = categories.get( index );
JComponent c = (JComponent) super.getListCellRendererComponent( list, value, index, isSelected, cellHasFocus );
String name = ((IJThemeInfo)value).name;
int sep = name.indexOf( '/' );
if( sep >= 0 )
name = name.substring( sep + 1 ).trim();
JComponent c = (JComponent) super.getListCellRendererComponent( list, name, index, isSelected, cellHasFocus );
if( title != null )
c.setBorder( new CompoundBorder( new ListCellTitledBorder( themesList, title ), c.getBorder() ) );
return c;
@@ -99,9 +104,28 @@ public class IJThemesPanel
themes.add( new IJThemeInfo( "Flat IntelliJ", null, null, null, FlatIntelliJLaf.class.getName() ) );
themes.add( new IJThemeInfo( "Flat Darcula", null, null, null, FlatDarculaLaf.class.getName() ) );
// add bundles themes
// add uncategorized bundled themes
categories.put( themes.size(), "IntelliJ Themes" );
themes.addAll( themesManager.bundledThemes );
for( IJThemeInfo ti : themesManager.bundledThemes ) {
if( !ti.name.contains( "/" ) )
themes.add( ti );
}
// add categorized bundled themes
String lastCategory = null;
for( IJThemeInfo ti : themesManager.bundledThemes ) {
int sep = ti.name.indexOf( '/' );
if( sep < 0 )
continue;
String category = ti.name.substring( 0, sep ).trim();
if( !Objects.equals( lastCategory, category ) ) {
lastCategory = category;
categories.put( themes.size(), category );
}
themes.add( ti );
}
// add themes from directory
categories.put( themes.size(), "Current Directory" );