Skip to content

Commit 57188bc

Browse files
tumuyanBambooin
authored andcommitted
perf: show ascii label when ascii_punct on
1 parent 3ae3273 commit 57188bc

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

app/src/main/java/com/osfans/trime/core/Rime.java

+8
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,14 @@ public static boolean isAsciiMode() {
292292
return mStatus.is_ascii_mode;
293293
}
294294

295+
public static boolean isAsciiPunch() {
296+
return mStatus.is_ascii_punct;
297+
}
298+
299+
public static boolean showAsciiPunch() {
300+
return mStatus.is_ascii_punct || mStatus.is_ascii_mode;
301+
}
302+
295303
public static RimeComposition getComposition() {
296304
if (mContext == null) return null;
297305
return mContext.composition;

app/src/main/java/com/osfans/trime/ime/keyboard/Key.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ public String getLabel() {
588588
Event event = getEvent();
589589
if (!TextUtils.isEmpty(label)
590590
&& event == getClick()
591-
&& (events[KeyEventType.ASCII.ordinal()] == null && !Rime.isAsciiMode()))
591+
&& (events[KeyEventType.ASCII.ordinal()] == null && !Rime.showAsciiPunch()))
592592
return label; // 中文狀態顯示標籤
593593
return event.getLabel();
594594
}

0 commit comments

Comments
 (0)