Skip to content

Commit

Permalink
perf: 优化
Browse files Browse the repository at this point in the history
  • Loading branch information
nopdan committed May 1, 2022
1 parent 289c2a9 commit c8b850f
Show file tree
Hide file tree
Showing 10 changed files with 307 additions and 155 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
其他
.prettierrc.js
trime.yaml

others/
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
[1]: https://github.com/cxcn/danjing
[2]: https://github.com/osfans/trime

**请勿使用 v3.2.2-20210918** 之后的版本

## 预览

![](./预览/default_without_hint.png)
Expand Down Expand Up @@ -33,7 +31,7 @@

```yaml
preset_keyboards:
__include: danjing:/kbs
__include: danjing:/preset_keyboards
```
像下面这样添加一段代码
Expand Down Expand Up @@ -107,8 +105,6 @@ conf:
__patch: 单静.patch.无障碍:/num_line?
# line: 33
style:
__include: 单静.trime:/style
key_height: 61 #符号、颜文字键盘 按键高度
__patch:
style/key_height: 61 #符号、颜文字键盘 按键高度
```
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@
config_version: '1.0'
author: 'Rea <[email protected]>' #作者资讯

preset_keys:
kb_xkjd6zj: { label: '助记', send: Eisu_toggle, select: xkjd6zj }
kb_xklbzj: { label: '助记', send: Eisu_toggle, select: xklbzj }
kb_xkybzj: { label: '助记', send: Eisu_toggle, select: xkybzj }
__include: 单静.trime:/
__patch:
style/keyboards/+:
- xkjd6zj
- xklbzj
- xkybzj
preset_keys/+:
kb_xkjd6zj: { label: '助记', send: Eisu_toggle, select: xkjd6zj }
kb_xklbzj: { label: '助记', send: Eisu_toggle, select: xklbzj }
kb_xkybzj: { label: '助记', send: Eisu_toggle, select: xkybzj }

preset_keyboards:
__include: 单静.trime:/preset_keyboards
xkjd6: #星空键道6
__include: 单静.trime:/preset_keyboards/flypy
__patch:
Expand Down
52 changes: 18 additions & 34 deletions 单静+.trime.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,28 @@ conf:
'keys/@after 6/': { click: num8 }
'keys/@after 7/': { click: num9 }
'keys/@after 8/': { click: num0 }
__patch:
__patch:
- 单静.patch.无障碍:/num?

style:
__include: 单静.trime:/style
key_height: 61 #符号、颜文字键盘 按键高度
__patch:
- 单静+.patch.声笔快码:/style?
- 单静+.patch.声笔拼音:/style?

fallback_colors:
__include: 单静.trime:/fallback_colors

preset_color_schemes:
__include: 单静.trime:/preset_color_schemes
__include: 单静.trime:/
__patch:
style/key_height: 61 #符号、颜文字键盘 按键高度
preset_keys/+:
num1: { label: 1, send: 1 }
num2: { label: 2, send: 2 }
num3: { label: 3, send: 3 }
num4: { label: 4, send: 4 }
num5: { label: 5, send: 5 }
num6: { label: 6, send: 6 }
num7: { label: 7, send: 7 }
num8: { label: 8, send: 8 }
num9: { label: 9, send: 9 }
num0: { label: 0, send: 0 }
kb_qwerty: { label: '36键', send: Eisu_toggle, select: default }
kb_qwertys: { label: '37键', send: Eisu_toggle, select: qwertys }
kb_qwerty_: { label: '40键', send: Eisu_toggle, select: qwerty_ }

preset_keyboards:
__include: danjing:/preset_keyboards

default:
__include: 单静.trime:/preset_keyboards/default
__patch: conf/plus
Expand Down Expand Up @@ -71,22 +74,3 @@ preset_keyboards:
func:
__include: 单静.trime:/preset_keyboards/func
height: { __include: conf/num_height }

android_keys:
__include: trime:/android_keys

preset_keys:
__include: 单静.trime:/preset_keys
num1: { label: 1, send: 1 }
num2: { label: 2, send: 2 }
num3: { label: 3, send: 3 }
num4: { label: 4, send: 4 }
num5: { label: 5, send: 5 }
num6: { label: 6, send: 6 }
num7: { label: 7, send: 7 }
num8: { label: 8, send: 8 }
num9: { label: 9, send: 9 }
num0: { label: 0, send: 0 }
kb_qwerty: { label: '36键', send: Eisu_toggle, select: default }
kb_qwertys: { label: '37键', send: Eisu_toggle, select: qwertys }
kb_qwerty_: { label: '40键', send: Eisu_toggle, select: qwerty_ }
136 changes: 136 additions & 0 deletions 单静+声笔字词.trime.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
# Trime style settings
# encoding: utf-8

__include: 单静+.trime:/
__patch:
preset_keys/space:
preview: ' '
repeatable: false
functional: false
send: space
style/keyboards/+:
- sbpy
- sbjm
- sbjz
- sbdp
- sbdz
- sbkm
- sbkx
- sbks
- sbkj
- sbkz
- sbfm
- sbfx
- sbfs
- sbfj
- sbfd
- sbfz
- sbxh
- sbhs
- sbhj
- sbhz
- sbzr
- sbzs
- sbzj
- sbzz
style:
__include: 单静+.trime:/style
# 候选区
## 候选
candidate_view_height: 28 #候选区高度
candidate_text_size: 18 #候选字号
## 编码
comment_on_top: false #编码提示在上方或右侧
comment_height: 16 #编码提示区高度
comment_text_size: 15 #编码提示字号

# 悬浮窗口
label_text_size: 16 #标签字号
text_size: 16 #编码区字号

window: #悬浮窗口组件
#- {start: "", move: 'ㄓ ', end: ""}
- { start: ' ', composition: '%s', end: ' ', letter_spacing: 0 } #letter_spacing需要>=Android5.0。TODO: 不为0时,会导致不换行的问题
- {
start: '',
label: '%s',
candidate: '%s',
comment: '%s',
end: '',
sep: ' ',
}
layout: #悬浮窗口设置
# 整体样式
position: fixed #位置:left|right|left_up|right_up|fixed|bottom_left|bottom_right|top_left|top_right(left、right需要>=Android5.0)
movable: false #是否可移动窗口,或仅移动一次 true|false|once
spacing: -1 #与预编辑或边缘的距离
margin_x: 5 #水平边距
margin_y: 1 #竖直边距
border: 0 #边框宽度
round_corner: 2 #窗口圆角
elevation: 0 #阴影(>=Android5.0)
alpha: 0xff #透明度(0-255)
#background: background.png #颜色或者backgrounds目录下的图片文件名
# 样式
all_phrases: false #所有满足条件的词语都显示在窗口
min_length: 0 #最小词长
max_length: 80 #超过字数则换行
sticky_lines: 1 #固顶行数
max_entries: 1 #最大词条数
max_width: 350 #最大宽度,超过则自动换行
max_height: 400 #最大高度
min_width: 0 #最小宽度
min_height: 0 #最小高度
line_spacing: 0 #候选词的行间距(px)
line_spacing_multiplier: 1 #候选词的行间距(倍数)

preset_keyboards:
__include: 单静+.trime:/preset_keyboards
sbpy: #声笔拼音
__include: 单静+.trime:/preset_keyboards/qwertys
sbjm: #声笔简码
__include: 单静+.trime:/preset_keyboards/qwertys
sbjz: #声笔简整
__include: 单静+.trime:/preset_keyboards/qwertys
sbdp: #声笔拼音
__include: 单静+.trime:/preset_keyboards/qwertys
sbdz: #声笔顶整
__include: 单静+.trime:/preset_keyboards/qwertys
sbkm: #声笔快码
__include: 单静+.trime:/preset_keyboards/qwertys
sbkx: #声笔快讯
__include: 单静+.trime:/preset_keyboards/qwertys
sbks: #声笔快速
__include: 单静+.trime:/preset_keyboards/qwertys
sbkj: #声笔快简
__include: 单静+.trime:/preset_keyboards/qwertys
sbkz: #声笔快整
__include: 单静+.trime:/preset_keyboards/qwertys
sbfm: #声笔飞码
__include: 单静+.trime:/preset_keyboards/qwertys
sbfx: #声笔飞讯
__include: 单静+.trime:/preset_keyboards/qwertys
sbfs: #声笔飞速
__include: 单静+.trime:/preset_keyboards/qwertys
sbfj: #声笔飞简
__include: 单静+.trime:/preset_keyboards/qwertys
sbfd: #声笔飞单
__include: 单静+.trime:/preset_keyboards/qwertys
sbfz: #声笔飞整
__include: 单静+.trime:/preset_keyboards/qwertys
sbxh: #声笔小鹤
__include: 单静+.trime:/preset_keyboards/qwertys
sbhs: #声笔鹤速
__include: 单静+.trime:/preset_keyboards/qwertys
sbhj: #声笔鹤简
__include: 单静+.trime:/preset_keyboards/qwertys
sbhz: #声笔鹤整
__include: 单静+.trime:/preset_keyboards/qwertys
sbzr: #声笔自然
__include: 单静+.trime:/preset_keyboards/qwertys
sbzs: #声笔自速
__include: 单静+.trime:/preset_keyboards/qwertys
sbzj: #声笔自简
__include: 单静+.trime:/preset_keyboards/qwertys
sbzz: #声笔自整
__include: 单静+.trime:/preset_keyboards/qwertys
Loading

0 comments on commit c8b850f

Please sign in to comment.