Skip to content

Commit 7f1d029

Browse files
authored
Merge pull request #178 from dinbtechit/chore/merry-chirstmas-2023
Chores - Deprecated APIs and dart highlighting fixes.
2 parents dfcfd5b + 754c1e8 commit 7f1d029

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# vscode-theme Changelog
44

55
## Unreleased
6+
### Fixed:
7+
- Removed internal APIs - So we can release v1.10.8
68

79
## 1.10.8 - 2023-12-17
810

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
pluginGroup = com.github.dinbtechit.vscodetheme
44
pluginName = VSCode Theme
55
# SemVer format -> https://semver.org
6-
pluginVersion = 1.10.8
6+
pluginVersion = 1.10.9
77

88
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
99
pluginSinceBuild = 233

src/main/kotlin/com/github/dinbtechit/vscodetheme/VSCodeThemeManager.kt

+10-12
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,8 @@ import com.github.dinbtechit.vscodetheme.settings.VSCodeThemeSettingsStore
44
import com.intellij.ide.plugins.IdeaPluginDescriptor
55
import com.intellij.ide.plugins.PluginManagerCore
66
import com.intellij.ide.ui.LafManager
7-
import com.intellij.ide.ui.LafManagerListener
8-
import com.intellij.ide.ui.ThemeListProvider
9-
import com.intellij.openapi.application.ApplicationManager
107
import com.intellij.openapi.extensions.PluginId
11-
import com.intellij.util.ui.JBUI
12-
import com.jetbrains.rd.util.string.printToString
8+
import com.intellij.util.containers.ContainerUtil
139

1410
/*enum class VSCodeTheme(val theme: String) {
1511
UNKNOWN("UNKNOWN"),
@@ -40,7 +36,7 @@ class VSCodeThemeManager {
4036
try {
4137
if (getPlugin()?.isEnabled != null) {
4238
val vscodeTheme =
43-
LafManager.getInstance().installedThemes.firstOrNull { it.toString().contains(VSCodeTheme.DARK) }
39+
LafManager.getInstance().installedLookAndFeels.firstOrNull { it.toString().contains(VSCodeTheme.DARK) }
4440
return vscodeTheme != null
4541
}
4642
return false
@@ -53,11 +49,12 @@ class VSCodeThemeManager {
5349
try {
5450
if (isVSCodeThemeReady()) {
5551
val convertedSelectedVSCodeTheme = convertOldToNewTheme(selectedVSCodeTheme)
56-
val vscodeTheme =
57-
LafManager.getInstance().installedThemes.firstOrNull { it.toString().contains(convertedSelectedVSCodeTheme) }
5852

53+
val vscodeTheme =
54+
LafManager.getInstance().installedLookAndFeels.firstOrNull { it.toString().contains(convertedSelectedVSCodeTheme) }
55+
ContainerUtil.find(LafManager.getInstance().installedLookAndFeels) { it.name === convertedSelectedVSCodeTheme}
5956
if (vscodeTheme != null) {
60-
LafManager.getInstance().currentUIThemeLookAndFeel = vscodeTheme
57+
LafManager.getInstance().currentLookAndFeel = vscodeTheme
6158
}
6259
if (always) {
6360
val settings = VSCodeThemeSettingsStore.instance
@@ -71,24 +68,25 @@ class VSCodeThemeManager {
7168
}
7269

7370
fun isVSCodeThemeSelected(): Boolean {
74-
val theme = LafManager.getInstance().currentUIThemeLookAndFeel
71+
val theme = LafManager.getInstance().currentLookAndFeel
7572
if (theme != null) {
7673
return theme.toString().contains(VSCodeTheme.DARK) && !theme.toString().contains("Modern")
7774
}
7875
return false
7976
}
8077

8178
fun isVSCodeDarkModernThemeSelected(): Boolean {
82-
val theme = LafManager.getInstance().currentUIThemeLookAndFeel
79+
val theme = LafManager.getInstance().currentLookAndFeel
8380
return theme?.toString()?.contains(VSCodeTheme.DARK_MODERN) ?: false
8481
}
8582

83+
84+
8685
private fun convertOldToNewTheme(theme: String): String {
8786
return when (theme) {
8887
"DARK_MODERN" -> "VSCode Dark Modern"
8988
"DARK" -> "VSCode Dark"
9089
else -> theme
9190
}
92-
9391
}
9492
}

0 commit comments

Comments
 (0)