mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IJPL-234117 Islands Darcula: Add the theme + migration
GitOrigin-RevId: 3e355772bcfb24428af800b9b0a6f88da42951f6
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ccbb31f9c0
commit
6a0e9089b4
@@ -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);
|
||||
|
||||
+11
-7
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user