Skip to content

Commit

Permalink
Merge pull request #388 from ensan-hcl/fix/qwerty_label_disappearance
Browse files Browse the repository at this point in the history
[Fix] ラベルが消失する不具合を修正
  • Loading branch information
ensan-hcl authored Jan 14, 2024
2 parents 4678407 + f29e781 commit b8e6ac2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct QwertySwitchLanguageKeyModel<Extension: ApplicationSpecificKeyboardViewEx
target = languages.1
} else if languages.1 == current {
target = languages.0
} else if SemiStaticStates.shared.needsInputModeSwitchKey {
} else if SemiStaticStates.shared.needsInputModeSwitchKey && [.ja_JP, .en_US, .el_GR].contains(variableStates.keyboardLanguage) {
target = variableStates.keyboardLanguage
} else {
target = Extension.SettingProvider.preferredLanguage.first
Expand Down Expand Up @@ -57,14 +57,14 @@ struct QwertySwitchLanguageKeyModel<Extension: ApplicationSpecificKeyboardViewEx

func label(width: CGFloat, states: VariableStates, color: Color?) -> KeyLabel<Extension> {
let current = currentTabLanguage(variableStates: states)
if languages.0 == current {
return KeyLabel(.selectable(languages.0.symbol, languages.1.symbol), width: width, textColor: color)
return if languages.0 == current {
KeyLabel(.selectable(languages.0.symbol, languages.1.symbol), width: width, textColor: color)
} else if languages.1 == current {
return KeyLabel(.selectable(languages.1.symbol, languages.0.symbol), width: width, textColor: color)
} else if SemiStaticStates.shared.needsInputModeSwitchKey {
return KeyLabel(.text(states.keyboardLanguage.symbol), width: width, textColor: color)
KeyLabel(.selectable(languages.1.symbol, languages.0.symbol), width: width, textColor: color)
} else if SemiStaticStates.shared.needsInputModeSwitchKey && [.ja_JP, .en_US, .el_GR].contains(states.keyboardLanguage) {
KeyLabel(.text(states.keyboardLanguage.symbol), width: width, textColor: color)
} else {
return KeyLabel(.text(Extension.SettingProvider.preferredLanguage.first.symbol), width: width, textColor: color)
KeyLabel(.text(Extension.SettingProvider.preferredLanguage.first.symbol), width: width, textColor: color)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ struct QwertyDataProvider<Extension: ApplicationSpecificKeyboardViewExtension> {
let targetTab: TabData = {
switch first {
case .en_US:
return .system(.user_english)
.system(.user_english)
case .ja_JP:
return .system(.user_japanese)
.system(.user_japanese)
case .none, .el_GR:
return .system(.user_japanese)
.system(.user_japanese)
}
}()
languageKey = QwertyFunctionalKeyModel(labelType: .text(first.symbol), rowInfo: rowInfo, pressActions: [.moveTab(targetTab)], longPressActions: .none, needSuggestView: false)
Expand Down

0 comments on commit b8e6ac2

Please sign in to comment.