diff --git a/CHANGELOG.md b/CHANGELOG.md index 1da8aab..b3a50c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,13 @@ ## [Unreleased] +## [1.4.0] - 2024-11-04 +### Changed +- #18: Added support for "Squirrel Method" (Chinese) (https://rime.im) on macOS. +- #20: Added support for "Russian - PC" on macOS. +- #21: Fixed color settings save bug; color settings now save correctly. + + ## [1.3.1] - 2024-08-26 ### Changed - Fix NullPointerException for Windows users. diff --git a/README.md b/README.md index 77530a8..1fdc8ac 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ This feature is particularly beneficial for developers juggling multiple languag - **🔒 Caps Lock Indicator:** Shows the Caps Lock status on the cursor. - **🔧 Customization:** Customize the language indicator's font, size, opacity, and position. - **🖥️ Supported Operating Systems:** Available on Windows, Mac, and Linux. -- **🌐 Supported Languages And Input Methods:** Supports multiple languages and input methods, including Sogou Pinyin Method (Chinese) for macOS. +- **🌐 Supported Languages And Input Methods:** Supports a wide range of languages and input methods, including Chinese Sogou Pinyin and Squirrel Methods on macOS. ## Usage diff --git a/gradle.properties b/gradle.properties index 01803c7..17c3f3a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ pluginGroup = com.github.siropkin.kursor pluginName = Kursor pluginRepositoryUrl = https://github.com/siropkin/kursor # SemVer format -> https://semver.org -pluginVersion = 1.3.1 +pluginVersion = 1.4.0 # Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html pluginSinceBuild = 232 diff --git a/src/main/kotlin/com/github/siropkin/kursor/KeyboardLayout.kt b/src/main/kotlin/com/github/siropkin/kursor/KeyboardLayout.kt index a152b06..bbf0631 100644 --- a/src/main/kotlin/com/github/siropkin/kursor/KeyboardLayout.kt +++ b/src/main/kotlin/com/github/siropkin/kursor/KeyboardLayout.kt @@ -79,7 +79,10 @@ private val windowsKeyboardVariantMap = mapOf( ) private val macKeyboardVariantMap = mapOf( - "UserDefined_com.sogou.inputmethod.pinyin" to "ZH" // https://pinyin.sogou.com/mac + "UserDefined_19458" to "RU", // Russian + "UserDefined_com.sogou.inputmethod.pinyin" to "ZH", // Sogou Pinyin: https://pinyin.sogou.com/mac + "UserDefined_im.rime.inputmethod.Squirrel.Hans" to "ZH", // Squirrel - Simplified: https://rime.im + "UserDefined_im.rime.inputmethod.Squirrel.Hant" to "ZH" // Squirrel - Traditional: https://rime.im ) class KeyboardLayoutInfo(private val language: String, private val country: String, private val variant: String) { diff --git a/src/main/kotlin/com/github/siropkin/kursor/settings/KursorSettings.kt b/src/main/kotlin/com/github/siropkin/kursor/settings/KursorSettings.kt index d671131..05fa185 100644 --- a/src/main/kotlin/com/github/siropkin/kursor/settings/KursorSettings.kt +++ b/src/main/kotlin/com/github/siropkin/kursor/settings/KursorSettings.kt @@ -6,7 +6,9 @@ import com.intellij.openapi.components.PersistentStateComponent import com.intellij.openapi.components.State import com.intellij.openapi.components.Storage import com.intellij.openapi.editor.colors.EditorColorsManager +import com.intellij.util.xmlb.Converter import com.intellij.util.xmlb.XmlSerializerUtil +import com.intellij.util.xmlb.annotations.OptionTag import java.awt.Color import java.awt.Font @@ -19,6 +21,7 @@ class KursorSettings : PersistentStateComponent { var defaultLanguage: String = "us" var changeColorOnNonDefaultLanguage: Boolean = true + @OptionTag("colorOnNonDefaultLanguage_", converter = ColorConverter::class) var colorOnNonDefaultLanguage: Color = Color(255, 140, 0) var showTextIndicator: Boolean = true @@ -48,3 +51,14 @@ class KursorSettings : PersistentStateComponent { } } } + +class ColorConverter : Converter() { + override fun fromString(value: String): Color { + val parts = value.split(",") + return Color(parts[0].toInt(), parts[1].toInt(), parts[2].toInt(), parts[3].toInt()) + } + + override fun toString(value: Color): String { + return "${value.red},${value.green},${value.blue},${value.alpha}" + } +}