feat(ui): 接入 vendor 真实图标库 + 图标选择器
- assets/icons/ 共 80+ 张真实品牌图标嵌入 UI 包 - entry 新增 IconKey 字段,持久化到 config.Entry.IconName - iconPickerDialog 网格布局图标选择器 - Add 完成后自动弹出图标选择器,Skip 则用 vendor 占位图 - ⋯ 菜单新增 "Change icon..." 项 - vendorIconFor 解析顺序:catalog → vendor 占位 → qr 兜底
This commit is contained in:
+10
-5
@@ -18,6 +18,7 @@ const (
|
||||
rowActionDelete
|
||||
rowActionMoveUp
|
||||
rowActionMoveDown
|
||||
rowActionChangeIcon
|
||||
)
|
||||
|
||||
// rowActionMenu is the small popup opened by the ⋯ button on each entry
|
||||
@@ -29,11 +30,12 @@ type rowActionMenu struct {
|
||||
canMoveUp bool
|
||||
canMoveDown bool
|
||||
|
||||
renameBtn widget.Clickable
|
||||
deleteBtn widget.Clickable
|
||||
moveUpBtn widget.Clickable
|
||||
moveDownBtn widget.Clickable
|
||||
cancelBtn widget.Clickable
|
||||
renameBtn widget.Clickable
|
||||
deleteBtn widget.Clickable
|
||||
moveUpBtn widget.Clickable
|
||||
moveDownBtn widget.Clickable
|
||||
changeIconBtn widget.Clickable
|
||||
cancelBtn widget.Clickable
|
||||
}
|
||||
|
||||
func newRowActionMenu(idx, total int) *rowActionMenu {
|
||||
@@ -61,6 +63,8 @@ func (m *rowActionMenu) Pick(gtx layout.Context) (rowAction, bool) {
|
||||
return rowActionNone, false
|
||||
}
|
||||
return rowActionMoveDown, true
|
||||
case m.changeIconBtn.Clicked(gtx):
|
||||
return rowActionChangeIcon, true
|
||||
case m.cancelBtn.Clicked(gtx):
|
||||
return rowActionNone, true
|
||||
}
|
||||
@@ -102,6 +106,7 @@ func (m *rowActionMenu) Layout(gtx layout.Context, th *material.Theme) layout.Di
|
||||
layout.Rigid(layout.Spacer{Height: unit.Dp(12)}.Layout),
|
||||
row(&m.renameBtn, i18n.T("action_rename"), true),
|
||||
row(&m.deleteBtn, i18n.T("action_delete"), true),
|
||||
row(&m.changeIconBtn, i18n.T("action_change_icon"), true),
|
||||
row(&m.moveUpBtn, i18n.T("action_move_up"), m.canMoveUp),
|
||||
row(&m.moveDownBtn, i18n.T("action_move_down"), m.canMoveDown),
|
||||
layout.Rigid(layout.Spacer{Height: unit.Dp(8)}.Layout),
|
||||
|
||||
Reference in New Issue
Block a user