Skip to content

Commit

Permalink
Merge pull request #178 from dinbtechit/chore/merry-chirstmas-2023
Browse files Browse the repository at this point in the history
Chores - Deprecated APIs and dart highlighting fixes.
  • Loading branch information
dinbtechit authored Jan 21, 2024
2 parents dfcfd5b + 754c1e8 commit 7f1d029
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# vscode-theme Changelog

## Unreleased
### Fixed:
- Removed internal APIs - So we can release v1.10.8

## 1.10.8 - 2023-12-17

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
pluginGroup = com.github.dinbtechit.vscodetheme
pluginName = VSCode Theme
# SemVer format -> https://semver.org
pluginVersion = 1.10.8
pluginVersion = 1.10.9

# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild = 233
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,8 @@ import com.github.dinbtechit.vscodetheme.settings.VSCodeThemeSettingsStore
import com.intellij.ide.plugins.IdeaPluginDescriptor
import com.intellij.ide.plugins.PluginManagerCore
import com.intellij.ide.ui.LafManager
import com.intellij.ide.ui.LafManagerListener
import com.intellij.ide.ui.ThemeListProvider
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.extensions.PluginId
import com.intellij.util.ui.JBUI
import com.jetbrains.rd.util.string.printToString
import com.intellij.util.containers.ContainerUtil

/*enum class VSCodeTheme(val theme: String) {
UNKNOWN("UNKNOWN"),
Expand Down Expand Up @@ -40,7 +36,7 @@ class VSCodeThemeManager {
try {
if (getPlugin()?.isEnabled != null) {
val vscodeTheme =
LafManager.getInstance().installedThemes.firstOrNull { it.toString().contains(VSCodeTheme.DARK) }
LafManager.getInstance().installedLookAndFeels.firstOrNull { it.toString().contains(VSCodeTheme.DARK) }
return vscodeTheme != null
}
return false
Expand All @@ -53,11 +49,12 @@ class VSCodeThemeManager {
try {
if (isVSCodeThemeReady()) {
val convertedSelectedVSCodeTheme = convertOldToNewTheme(selectedVSCodeTheme)
val vscodeTheme =
LafManager.getInstance().installedThemes.firstOrNull { it.toString().contains(convertedSelectedVSCodeTheme) }

val vscodeTheme =
LafManager.getInstance().installedLookAndFeels.firstOrNull { it.toString().contains(convertedSelectedVSCodeTheme) }
ContainerUtil.find(LafManager.getInstance().installedLookAndFeels) { it.name === convertedSelectedVSCodeTheme}
if (vscodeTheme != null) {
LafManager.getInstance().currentUIThemeLookAndFeel = vscodeTheme
LafManager.getInstance().currentLookAndFeel = vscodeTheme
}
if (always) {
val settings = VSCodeThemeSettingsStore.instance
Expand All @@ -71,24 +68,25 @@ class VSCodeThemeManager {
}

fun isVSCodeThemeSelected(): Boolean {
val theme = LafManager.getInstance().currentUIThemeLookAndFeel
val theme = LafManager.getInstance().currentLookAndFeel
if (theme != null) {
return theme.toString().contains(VSCodeTheme.DARK) && !theme.toString().contains("Modern")
}
return false
}

fun isVSCodeDarkModernThemeSelected(): Boolean {
val theme = LafManager.getInstance().currentUIThemeLookAndFeel
val theme = LafManager.getInstance().currentLookAndFeel
return theme?.toString()?.contains(VSCodeTheme.DARK_MODERN) ?: false
}



private fun convertOldToNewTheme(theme: String): String {
return when (theme) {
"DARK_MODERN" -> "VSCode Dark Modern"
"DARK" -> "VSCode Dark"
else -> theme
}

}
}

0 comments on commit 7f1d029

Please sign in to comment.