Show English mode in the input method icon
macOS: the input method now has two input modes in Info.plist, 中英自動 ("注")
and 英文 ("A"), each with its own menu-bar icon. A Shift tap with nothing typed
switches the mode (TISSelectInputSource), and choosing a mode in the menu bar
switches the engine (setValue:forTag:). --register enables both modes.
Windows: the taskbar IME icon switches between icon.ico and icon-en.ico.
Linux: the IBus mode property also switches its icon.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -345,6 +345,9 @@ class AutoZhuyinEngine(IBus.Engine):
|
||||
english = self.engine.english_mode
|
||||
self.mode_prop.set_label(IBus.Text.new_from_string("英文" if english else "中英自動"))
|
||||
self.mode_prop.set_symbol(IBus.Text.new_from_string("英" if english else "自"))
|
||||
icon = os.path.join(HERE, "icon-en.png" if english else "icon.png")
|
||||
if os.path.exists(icon):
|
||||
self.mode_prop.set_icon(icon) # panels that show property icons
|
||||
self.update_property(self.mode_prop)
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
↓ 開啟游標前那個字或詞的候選字,按數字鍵 1–9 選字;
|
||||
選過的字會被記住,下次優先出現
|
||||
Esc 取消組字
|
||||
單按 Shift 切換英文模式(按鍵直接送出),再單按一次回到中英自動判斷
|
||||
單按 Shift 切換英文模式(按鍵直接送出,狀態圖示變成「英」),再單按一次回到中英自動判斷
|
||||
Shift+字母 打大寫字母(也會強制英文)
|
||||
` + 標點 強制全形標點,例如 `< 或 `, = , `. = 。 `/ = ? `; = ;
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ fi
|
||||
rm -rf "$DEST"
|
||||
mkdir -p "$DEST"
|
||||
cp -R autozhuyin autozhuyin_ibus.py version.txt tools "$DEST/"
|
||||
for f in icon.png THIRD_PARTY_LICENSES.txt GPL-3.0.txt; do [ -f "$f" ] && cp "$f" "$DEST/"; done
|
||||
for f in icon.png icon-en.png THIRD_PARTY_LICENSES.txt GPL-3.0.txt; do [ -f "$f" ] && cp "$f" "$DEST/"; done
|
||||
[ -n "$VENDOR_BACKUP" ] && mv "$VENDOR_BACKUP/vendor" "$DEST/" && rmdir "$VENDOR_BACKUP"
|
||||
chmod +x "$DEST/autozhuyin_ibus.py"
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@ class Property:
|
||||
def set_label(self, t): self.label = t.text
|
||||
def set_symbol(self, t): pass
|
||||
def set_state(self, s): self.state = s
|
||||
def set_icon(self, path): self.icon = path
|
||||
|
||||
|
||||
class Engine:
|
||||
|
||||
Reference in New Issue
Block a user