Skip to content

Commit

Permalink
Merge pull request #78 from ipuppet/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
ipuppet authored Oct 1, 2022
2 parents ad9ae03 + b923836 commit 1c19314
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"info": {
"name": "CAIO",
"version": "1.6.5",
"version": "1.6.7",
"author": "ipuppet",
"module": false
},
Expand Down
2 changes: 1 addition & 1 deletion dist/CAIO-en.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/CAIO-zh-Hans.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/CAIO.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion scripts/libs/easy-jsbox.js

Large diffs are not rendered by default.

16 changes: 7 additions & 9 deletions scripts/ui/keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,22 +228,20 @@ class Keyboard extends Clipboard {
bgcolor: $color("clear"),
tintColor: UIKit.textColor,
titleColor: UIKit.textColor,
contentEdgeInsets: $insets(0, 0, 0, 0),
titleEdgeInsets: $insets(0, 0, 0, 0),
imageEdgeInsets: $insets(0, 0, 0, 0),
info: { align }
},
button.menu ? { menu: button.menu } : {}
),
events: Object.assign({}, button.tapped ? { tapped: button.tapped } : {}, button.events),
layout: (make, view) => {
if (button.title) {
const width = $text.sizeThatFits({
const fontSize = $text.sizeThatFits({
text: button.title,
width: UIKit.windowSize.width,
font: $font(16)
})
make.size.equalTo($size(Math.ceil(width.width), size.height))
const width = Math.ceil(fontSize.width) + edges // 文本按钮增加内边距
make.size.equalTo($size(width, size.height))
} else {
make.size.equalTo(size)
}
Expand All @@ -252,8 +250,8 @@ class Keyboard extends Clipboard {
if (align === UIKit.align.right) make.right.equalTo(view.prev.left)
else make.left.equalTo(view.prev.right)
} else {
// 图片类型留一半边距,图标和按钮边距是另一半
const thisEdges = button.symbol ? edges / 2 : edges
// 留一半边距,按钮内边距是另一半
const thisEdges = edges / 2
if (align === UIKit.align.right) make.right.inset(thisEdges)
else make.left.inset(thisEdges)
}
Expand All @@ -272,7 +270,7 @@ class Keyboard extends Clipboard {
],
layout: (make, view) => {
make.bottom.left.right.equalTo(view.super.safeArea)
make.top.equalTo(view.prev.bottom).offset(3)
make.top.equalTo(view.prev.bottom)
}
}
}
Expand Down Expand Up @@ -320,7 +318,7 @@ class Keyboard extends Clipboard {
layout: (make, view) => {
make.top.equalTo(this.navHeight)
make.width.equalTo(view.super)
make.bottom.equalTo(view.super).offset(-this.navHeight)
make.bottom.equalTo(view.super.safeAreaBottom).offset(-this.navHeight)
}
}
}
Expand Down

0 comments on commit 1c19314

Please sign in to comment.