Skip to content

Commit

Permalink
优化图标显示
Browse files Browse the repository at this point in the history
  • Loading branch information
ipuppet committed Jul 8, 2024
1 parent abca238 commit a6cd6c1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 24 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": "2.3.1",
"version": "2.3.2",
"author": "ipuppet",
"module": false
},
Expand Down
2 changes: 1 addition & 1 deletion dist/CAIO.json

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.

34 changes: 13 additions & 21 deletions scripts/widget/Actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,19 @@ class ActionsWidget {
frame: {
width: size,
height: size
}
},
resizable: true
}
}
if (action.icon.startsWith("icon_")) {
// TODO: 优化 icon_ 的处理
// view.props.image = $icon(
// action.icon?.slice(5, action.icon.indexOf(".")),
// $color("#ffffff"),
// $size(size, size)
// )
view.props.image = $icon(
action.icon?.slice(5, action.icon.indexOf(".")),
$color("#ffffff"),
$size(size, size)
)
.ocValue()
.$image()
.jsValue()
} else if (action.icon.indexOf("/") > -1) {
view.props.image = $image(action.icon)
} else {
Expand Down Expand Up @@ -94,7 +97,7 @@ class ActionsWidget {
type: "hstack",
modifiers: [
{
background: $color(action.color),
background: this.kernel.actions.views.getColor(action.color),
frame: {
width: 50,
height: 50
Expand All @@ -107,18 +110,7 @@ class ActionsWidget {
}
}
],
views: [
{
type: "image",
props: {
symbol: {
glyph: action.icon,
size: 50 * 0.6
},
color: $color("#ffffff")
}
}
]
views: [this.getIcon(action, 50 * 0.6)]
}
]
},
Expand Down Expand Up @@ -196,7 +188,7 @@ class ActionsWidget {
type: "hstack",
modifiers: [
{
background: $color(action.color),
background: this.kernel.actions.views.getColor(action.color),
frame: {
width: itemHeight,
height: itemHeight
Expand Down

0 comments on commit a6cd6c1

Please sign in to comment.