From e9779fede45b6f0b50d6061d982c121f0be19e46 Mon Sep 17 00:00:00 2001 From: siropkin Date: Fri, 1 Nov 2024 15:35:53 -0400 Subject: [PATCH 1/7] #18 Add support for Squirrel Method (https://rime.im) in MacOS --- src/main/kotlin/com/github/siropkin/kursor/KeyboardLayout.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/com/github/siropkin/kursor/KeyboardLayout.kt b/src/main/kotlin/com/github/siropkin/kursor/KeyboardLayout.kt index a152b06..22e1c73 100644 --- a/src/main/kotlin/com/github/siropkin/kursor/KeyboardLayout.kt +++ b/src/main/kotlin/com/github/siropkin/kursor/KeyboardLayout.kt @@ -79,7 +79,9 @@ private val windowsKeyboardVariantMap = mapOf( ) private val macKeyboardVariantMap = mapOf( - "UserDefined_com.sogou.inputmethod.pinyin" to "ZH" // https://pinyin.sogou.com/mac + "UserDefined_com.sogou.inputmethod.pinyin" to "ZH", // https://pinyin.sogou.com/mac + "UserDefined_im.rime.inputmethod.Squirrel.Hans" to "SS", // Squirrel - Simplified: https://rime.im + "UserDefined_im.rime.inputmethod.Squirrel.Hant" to "ST" // Squirrel - Traditional: https://rime.im ) class KeyboardLayoutInfo(private val language: String, private val country: String, private val variant: String) { From 2ca09a02f15af03a2cfc499a40e4722c2dc3f881 Mon Sep 17 00:00:00 2001 From: siropkin Date: Fri, 1 Nov 2024 15:41:17 -0400 Subject: [PATCH 2/7] #20 Add support for "Russian - PC" in MacOS --- src/main/kotlin/com/github/siropkin/kursor/KeyboardLayout.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/com/github/siropkin/kursor/KeyboardLayout.kt b/src/main/kotlin/com/github/siropkin/kursor/KeyboardLayout.kt index 22e1c73..84f652c 100644 --- a/src/main/kotlin/com/github/siropkin/kursor/KeyboardLayout.kt +++ b/src/main/kotlin/com/github/siropkin/kursor/KeyboardLayout.kt @@ -79,7 +79,8 @@ 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 "SS", // Squirrel - Simplified: https://rime.im "UserDefined_im.rime.inputmethod.Squirrel.Hant" to "ST" // Squirrel - Traditional: https://rime.im ) From 5ee1418496eb7461d0d736ac6578bea68ec985a9 Mon Sep 17 00:00:00 2001 From: siropkin Date: Sat, 2 Nov 2024 16:46:03 -0400 Subject: [PATCH 3/7] #21 Fix color setting save bug (add ColorConverter to serialize and deserialize colorOnNonDefaultLanguage setting) --- CHANGELOG.md | 7 +++++++ .../siropkin/kursor/settings/KursorSettings.kt | 18 +++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1da8aab..26be0b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,13 @@ ## [Unreleased] +## [1.4.0] - 2024-11-... (TBD) +### Changed +- #18 Add support of "Squirrel Method" (Chinese) (https://rime.im) for macOS. +- #20 Add support of "Russian - PC" for macOS. +- #21 Add ColorConverter to serialize and deserialize colorOnNonDefaultLanguage setting + + ## [1.3.1] - 2024-08-26 ### Changed - Fix NullPointerException for Windows users. 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..196df17 100644 --- a/src/main/kotlin/com/github/siropkin/kursor/settings/KursorSettings.kt +++ b/src/main/kotlin/com/github/siropkin/kursor/settings/KursorSettings.kt @@ -6,11 +6,15 @@ 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 +val COLOR_ON_NON_DEFAULT_LANGUAGE = Color(255, 140, 0) + @State( name = "package com.github.siropkin.kursor.settings.KursorSettings", storages = [Storage("Kursor.xml")] @@ -19,7 +23,8 @@ class KursorSettings : PersistentStateComponent { var defaultLanguage: String = "us" var changeColorOnNonDefaultLanguage: Boolean = true - var colorOnNonDefaultLanguage: Color = Color(255, 140, 0) + @OptionTag("colorOnNonDefaultLanguage_", converter = ColorConverter::class) + var colorOnNonDefaultLanguage: Color = COLOR_ON_NON_DEFAULT_LANGUAGE var showTextIndicator: Boolean = true @@ -48,3 +53,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}" + } +} From 0c234e0ae99a4a0349d732d192d770b3b086b629 Mon Sep 17 00:00:00 2001 From: Ivan Seredkin Date: Sat, 2 Nov 2024 20:31:51 -0400 Subject: [PATCH 4/7] #18 #20 #21 Update plugin version, CHANGELOG.md and README.md --- CHANGELOG.md | 6 +++--- README.md | 2 +- gradle.properties | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 26be0b6..c050598 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,9 +5,9 @@ ## [1.4.0] - 2024-11-... (TBD) ### Changed -- #18 Add support of "Squirrel Method" (Chinese) (https://rime.im) for macOS. -- #20 Add support of "Russian - PC" for macOS. -- #21 Add ColorConverter to serialize and deserialize colorOnNonDefaultLanguage setting +- #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 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 From 9a246254f34c86feb262493b150b9ef1191d095e Mon Sep 17 00:00:00 2001 From: Ivan Seredkin Date: Sat, 2 Nov 2024 20:33:26 -0400 Subject: [PATCH 5/7] #21 Get rid of COLOR_ON_NON_DEFAULT_LANGUAGE --- .../com/github/siropkin/kursor/settings/KursorSettings.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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 196df17..05fa185 100644 --- a/src/main/kotlin/com/github/siropkin/kursor/settings/KursorSettings.kt +++ b/src/main/kotlin/com/github/siropkin/kursor/settings/KursorSettings.kt @@ -13,8 +13,6 @@ import java.awt.Color import java.awt.Font -val COLOR_ON_NON_DEFAULT_LANGUAGE = Color(255, 140, 0) - @State( name = "package com.github.siropkin.kursor.settings.KursorSettings", storages = [Storage("Kursor.xml")] @@ -24,7 +22,7 @@ class KursorSettings : PersistentStateComponent { var changeColorOnNonDefaultLanguage: Boolean = true @OptionTag("colorOnNonDefaultLanguage_", converter = ColorConverter::class) - var colorOnNonDefaultLanguage: Color = COLOR_ON_NON_DEFAULT_LANGUAGE + var colorOnNonDefaultLanguage: Color = Color(255, 140, 0) var showTextIndicator: Boolean = true From 25dfcb7710d029be617f5741368b31090bc91a18 Mon Sep 17 00:00:00 2001 From: Ivan Seredkin Date: Mon, 4 Nov 2024 08:08:19 -0500 Subject: [PATCH 6/7] #18 Use ZH as Squirrel Method abbreviation --- src/main/kotlin/com/github/siropkin/kursor/KeyboardLayout.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/github/siropkin/kursor/KeyboardLayout.kt b/src/main/kotlin/com/github/siropkin/kursor/KeyboardLayout.kt index 84f652c..bbf0631 100644 --- a/src/main/kotlin/com/github/siropkin/kursor/KeyboardLayout.kt +++ b/src/main/kotlin/com/github/siropkin/kursor/KeyboardLayout.kt @@ -81,8 +81,8 @@ private val windowsKeyboardVariantMap = mapOf( private val macKeyboardVariantMap = mapOf( "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 "SS", // Squirrel - Simplified: https://rime.im - "UserDefined_im.rime.inputmethod.Squirrel.Hant" to "ST" // Squirrel - Traditional: https://rime.im + "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) { From 842c2e131107f0664d99f400d980046993b13880 Mon Sep 17 00:00:00 2001 From: Ivan Seredkin Date: Mon, 4 Nov 2024 08:27:07 -0500 Subject: [PATCH 7/7] #18 Update v1.4.0 release date --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c050598..b3a50c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## [Unreleased] -## [1.4.0] - 2024-11-... (TBD) +## [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.