Skip to content

Commit

Permalink
Merge pull request #208 from wdhongtw/setting-schema
Browse files Browse the repository at this point in the history
feat: add value range to setting schema file
  • Loading branch information
kanru authored Jul 2, 2024
2 parents d4d6e18 + 3bc70f9 commit d0dffe2
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/IBusChewingProperties.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ MkdgPropertySpec propSpecs[] = {
N_("Escape key cleans the text in pre-edit-buffer"), NULL},
{G_TYPE_INT, "max-chi-symbol-len", PAGE_EDITING,
N_("Maximum Chinese characters"), IBUS_CHEWING_PROPERTIES_SUBSECTION, "20",
NULL, NULL, 11, 33, maxChiSymbolLen_apply_callback, 0,
NULL, NULL, 0, 39, maxChiSymbolLen_apply_callback, 0,

This comment has been minimized.

Copy link
@hiunnhue

hiunnhue Jul 3, 2024

Collaborator

請問……在什麼情境下,使用者會想要把編輯區的長度設為 0?

之前是考慮到使用者詞彙最短9個字(Ctrl+9),再額外加上幾個字做為緩衝
而且在某個版本之前,組字中的符號也會算在編輯區的長度裡面,所以才會將最小值設為11,最大值設為33

This comment has been minimized.

Copy link
@kanru

kanru Jul 3, 2024

Author Member

既然 libchewing 可以支援 0~39 我覺得沒有必要特別限制?如果使用者覺得不方便那就不要設定那麼短就好了。

N_("Maximum Chinese characters in pre-edit buffer, not including inputing "
"Zhuyin symbols."),
NULL},
Expand Down
46 changes: 46 additions & 0 deletions src/setup/org.freedesktop.IBus.Chewing.gschema.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,40 @@
<schemalist>
<schema id="org.freedesktop.IBus.Chewing" path="/desktop/ibus/engine/chewing/" gettext-domain="ibus-chewing">
<key name="kb-type" type="s">
<choices>
<choice value="default"/>
<choice value="hsu"/>
<choice value="ibm"/>
<choice value="gin_yieh"/>
<choice value="eten"/>
<choice value="eten26"/>
<choice value="dvorak"/>
<choice value="dvorak_hsu"/>
<choice value="dachen_26"/>
<choice value="hanyu"/>
<choice value="thl_pinying"/>
<choice value="mps2_pinyin"/>
<choice value="carpalx"/>
<choice value="colemak_dh_ansi"/>
<choice value="colemak_dh_orth"/>
</choices>
<default l10n="messages">"default"</default>
<summary>Keyboard Type</summary>
<description>
Select Zhuyin keyboard layout
</description>
</key>
<key name="sel-keys" type="s">
<choices>
<choice value="1234567890"/>
<choice value="asdfghjkl;"/>
<choice value="asdfzxcv89"/>
<choice value="asdfjkl789"/>
<choice value="aoeu;qjkix"/>
<choice value="aoeuhtnsid"/>
<choice value="aoeuidhtns"/>
<choice value="1234qweras"/>
</choices>
<default>"1234567890"</default>
<summary>Selection keys</summary>
<description>
Expand Down Expand Up @@ -59,19 +86,32 @@
</description>
</key>
<key name="max-chi-symbol-len" type="i">
<range min="0" max="39"/>
<default>20</default>
<summary>Maximum Chinese characters</summary>
<description>
Maximum Chinese characters in pre-edit buffer, not including inputing Zhuyin symbols.
</description>
</key>
<key name="chi-eng-mode-toggle" type="s">
<choices>
<choice value="caps_lock"/>
<choice value="shift"/>
<choice value="shift_l"/>
<choice value="shift_r"/>
</choices>
<default l10n="messages">"caps_lock"</default>
<summary>Chinese/Alphanumeric Mode Toggle Key</summary>
<description>
</description>
</key>
<key name="default-english-case" type="s">
<choices>
<choice value="no default"/>
<choice value="lowercase"/>
<choice value="uppercase"/>
<choice value="shift_r"/>

This comment has been minimized.

Copy link
@hiunnhue

hiunnhue Jul 3, 2024

Collaborator

added by accident?

This comment has been minimized.

Copy link
@kanru

kanru Jul 3, 2024

Author Member

看起來是多餘的沒錯

</choices>
<default l10n="messages">"lowercase"</default>
<summary>Default English letter case
(Only effective when Caps Lock is the toggle key)</summary>
Expand All @@ -82,6 +122,11 @@
</description>
</key>
<key name="sync-caps-lock" type="s">
<choices>
<choice value="disable"/>
<choice value="keyboard"/>
<choice value="input method"/>
</choices>
<default l10n="messages" context="Sync">"keyboard"</default>
<summary>Sync between CapsLock and IM</summary>
<description>
Expand All @@ -99,6 +144,7 @@
</description>
</key>
<key name="cand-per-page" type="u">
<range min="4" max="10"/>
<default>5</default>
<summary>Candidate per page</summary>
<description>
Expand Down

0 comments on commit d0dffe2

Please sign in to comment.