File tree 2 files changed +4
-30
lines changed
2 files changed +4
-30
lines changed Original file line number Diff line number Diff line change @@ -113,34 +113,6 @@ final class SquirrelConfig {
113
113
rimeAPI. config_end ( & iterator)
114
114
return appOptions
115
115
}
116
-
117
- // isLinear
118
- func updateCandidateListLayout( prefix: String ) -> Bool {
119
- let candidateListLayout = getString ( " \( prefix) /candidate_list_layout " )
120
- switch candidateListLayout {
121
- case " stacked " :
122
- return false
123
- case " linear " :
124
- return true
125
- default :
126
- // Deprecated. Not to be confused with text_orientation: horizontal
127
- return getBool ( " \( prefix) /horizontal " ) ?? false
128
- }
129
- }
130
-
131
- // isVertical
132
- func updateTextOrientation( prefix: String ) -> Bool {
133
- let textOrientation = getString ( " \( prefix) /text_orientation " )
134
- switch textOrientation {
135
- case " horizontal " :
136
- return false
137
- case " vertical " :
138
- return true
139
- default :
140
- // Deprecated.
141
- return getBool ( " \( prefix) /vertical " ) ?? false
142
- }
143
- }
144
116
}
145
117
146
118
private extension SquirrelConfig {
Original file line number Diff line number Diff line change @@ -166,8 +166,8 @@ final class SquirrelTheme {
166
166
}
167
167
168
168
func load( config: SquirrelConfig , dark: Bool ) {
169
- linear = config. updateCandidateListLayout ( prefix : " style " )
170
- vertical = config. updateTextOrientation ( prefix : " style " )
169
+ linear ? = config. getString ( " style/candidate_list_layout " ) . map { $0 == " linear " }
170
+ vertical ? = config. getString ( " style/text_orientation " ) . map { $0 == " vertical " }
171
171
inlinePreedit ?= config. getBool ( " style/inline_preedit " )
172
172
inlineCandidate ?= config. getBool ( " style/inline_candidate " )
173
173
translucency ?= config. getBool ( " style/translucency " )
@@ -219,6 +219,8 @@ final class SquirrelTheme {
219
219
// the following per-color-scheme configurations, if exist, will
220
220
// override configurations with the same name under the global 'style'
221
221
// section
222
+ linear ?= config. getString ( " \( prefix) /candidate_list_layout " ) . map { $0 == " linear " }
223
+ vertical ?= config. getString ( " \( prefix) /text_orientation " ) . map { $0 == " vertical " }
222
224
inlinePreedit ?= config. getBool ( " \( prefix) /inline_preedit " )
223
225
inlineCandidate ?= config. getBool ( " \( prefix) /inline_candidate " )
224
226
translucency ?= config. getBool ( " \( prefix) /translucency " )
You can’t perform that action at this time.
0 commit comments