IJPL-234117 Islands Darcula: Add the theme + migration

GitOrigin-RevId: 3e355772bcfb24428af800b9b0a6f88da42951f6
This commit is contained in:
Alexander Lobas
2026-02-13 11:17:03 +00:00
committed by intellij-monorepo-bot
parent ccbb31f9c0
commit 6a0e9089b4
3 changed files with 21 additions and 7 deletions
@@ -75,6 +75,11 @@ public abstract class LafManager {
public abstract boolean getAutodetectSupported();
@ApiStatus.Internal
public @Nullable String getPreferredDarkThemeId() {
return null;
}
public abstract void setPreferredDarkLaf(@NotNull UIThemeLookAndFeelInfo value);
public abstract void setPreferredLightLaf(@NotNull UIThemeLookAndFeelInfo value);
@@ -146,21 +146,25 @@ private suspend fun enableIslandsDarcula(properties: PropertiesComponent) {
properties.setValue("ide.islands.new.darcula", true)
val lafManager = serviceAsync<LafManager>()
val currentTheme = lafManager.currentUIThemeLookAndFeel?.id ?: return
if (currentTheme != "Darcula") {
return
}
val id = PluginId.getId("com.intellij.classic.ui")
if (PluginManagerCore.findPlugin(id) != null && !PluginManagerCore.isDisabled(id)) {
return
}
val lafManager = serviceAsync<LafManager>()
val currentTheme = lafManager.currentUIThemeLookAndFeel?.id ?: return
val themeManager = serviceAsync<UiThemeProviderListManager>()
val newTheme = themeManager.findThemeById("Islands Darcula") ?: return
if (currentTheme != "Darcula") {
if (lafManager.autodetect && JBColor.isBright() && lafManager.preferredDarkThemeId == "Darcula") {
lafManager.setPreferredDarkLaf(newTheme)
}
return
}
lafManager.setCurrentLookAndFeel(newTheme, true)
lafManager.setPreferredDarkLaf(newTheme)
lafManager.updateUI()
}
@@ -964,6 +964,11 @@ class LafManagerImpl(private val coroutineScope: CoroutineScope) : LafManager(),
return result
}
@Internal
override fun getPreferredDarkThemeId(): String? {
return preferredDarkThemeId
}
override fun setPreferredDarkLaf(value: UIThemeLookAndFeelInfo) {
preferredDarkThemeId = value.id
}