Repository navigation
Conversation
Collaborator
|
喵喵,测试了嘛
***@***.***>
时间: 2026年10月17日 (周六) 19:22
主题: [InkCanvasForClass/community] feat(plugin): 支持插件工具栏手动添加配置与设置页导航图标显示优化 (PR #716)
***@***.***>
***@***.***>
动机 / 解决的问题 (Motivation)
1. 工具栏项强行插入问题:此前插件向宿主注册浮动或白板工具栏项时,首次加载会被宿主默认强行追加到用户的当前活跃工具栏中。对于部分非核心、需要让用户“按需手动启用”的插件组件,强行占用工具栏槽位并不合理。
2. 设置页插件图标单调:设置中心左侧导航栏中的插件配置入口,以往统一硬编码为默认齿轮图标(
\uE713
),未能呈现插件自身的品牌/功能图标。
主要改动 (Key Changes)
1. 插件工具栏支持
AutoAddToActiveConfig
控制
• 在
InkCanvas.PluginSdk/IPluginHost.cs
的
PluginToolbarItemInfo
中新增属性:
/// <summary>/// 是否在插件首次注册时自动添加到当前活跃工具栏配置中。/// 默认为 true。若设为 false,则仅添加到工具栏组件库,需用户在设置中手动添加。/// </summary>publicboolAutoAddToActiveConfig{get;set;}=true;
• 在
PluginManager.cs
中:
• 注册工具栏项时结合
isFirstRegistration && itemInfo.AutoAddToActiveConfig
判定是否自动入栏。
• 合并并统一了批量插件加载时的工具栏排队刷新逻辑(
FlushPendingToolbarRebuild
),同时支持白板工具栏与浮动工具栏,避免插件热加载/批量加载时频繁重建引发界面闪烁。
2. 设置中心导航栏插件图标自适应渲染
• 在
SettingsWindow.xaml.cs
中实现
CreatePluginNavItemIcon
:
• 优先检测插件清单
manifest.json
中的
Icon
配置。
• 若未配置,按优先级探测插件根目录的
icon_mono.png
或
icon.png
。
• 命中后以 16x16 的
BitmapIcon
(
ShowAsMonochrome = true
)展示,保持 Fluent 整体视觉协调;若均未提供,安全回退到默认齿轮图标。
验证情况 (Verification)
• 配置
AutoAddToActiveConfig = false
的插件组件首次加载时,不会强行插入用户的浮动/白板工具栏,同时在“自定义工具栏”管理列表中正常展示供拖拽添加。
• 设置中心左侧插件入口能正确显示插件提供的自定义图标,没有图标的插件正常显示默认齿轮。
• 项目可正常编译通过,无引入破坏性改动。
You can view, comment on, or merge this pull request online at:
#716
Commit Summary
• eaed288<eaed288> feat(plugin): 支持插件工具栏手动添加配置与设置页导航图标显示优化
File Changes
(3 files<https://github.com/InkCanvasForClass/community/pull/716/files>)
• MInk Canvas/Plugins/PluginManager.cs<https://github.com/InkCanvasForClass/community/pull/716/files#diff-de620dc08065204be3dd45ae07c167982b4565dbeffeef85aadb983f78f5e701>
(48)
• MInk Canvas/Windows/SettingsViews/SettingsWindow.xaml.cs<https://github.com/InkCanvasForClass/community/pull/716/files#diff-9a842ad61a1a404342bc46743d34d15a5e490a99806eb19eb561478f54199a49>
(54)
• MInkCanvas.PluginSdk/IPluginHost.cs<https://github.com/InkCanvasForClass/community/pull/716/files#diff-d0bd4fc3ba089c7e4d154697c6dbda61c1965619e49b7e03f4da32f7916a8c74>
(6)
… Patch Links:
• https://github.com/InkCanvasForClass/community/pull/716.patch
• https://github.com/InkCanvasForClass/community/pull/716.diff
—
Reply to this email directly, view it on GitHub<#716?email_source=notifications&email_token=BAJD3K4TPRBS45CFQVRH2DL5UNJAVA5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF42DQOJZGYZTIOJYGOTHEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVRTG633UMVZF6Y3MNFRWW>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BAJD3K2YZUDGECJC5FHY35D5UNJAVAVCNFSNUABFKJSXA33TNF2G64TZHM4TQOJWG43TSMJTHNEXG43VMU5TKOBZG44DCNBSHE42C5QC>.
You are receiving this because you are subscribed to this thread.[image: https://github.com/notifications/beacon/BAJD3KYZPKUXS7UZGC5OY7L5UNJAVBFCNFSM6AAAAADCNPMNYGWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHQAAAAAFPYTAI3UZZGKYLTN5XKU43VMJZWG4TJMJSWI.gif]Message ID: ***@***.***>
|
Member
|
无问题则可合并 |
Member
|
暂未发现可用图标的插件,所以我不知道有没有问题 |
Contributor
Author
|
This was referenced Oct 24, 2026
PANDAJSR
force-pushed
the
feat/custom-video-booth
branch
from
October 24, 2026 01:47
9ba0eb7 to
eaed288
Compare
Contributor
Author
|
补充本机回归验证(2026-10-25),针对本 PR 原始 head
验证源码、复跑脚本、构建及逐项日志:完整证据( 仍待人工验证:完整启动后的设置导航图标、组件库手动添加、用户删除组件后重启不自动加回,以及完整插件热重载。本次不将这些场景标记为已通过。 |
Member
|
请及时测试 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
动机 / 解决的问题 (Motivation)
\uE713),未能呈现插件自身的品牌/功能图标。主要改动 (Key Changes)
1. 插件工具栏支持
AutoAddToActiveConfig控制InkCanvas.PluginSdk/IPluginHost.cs的PluginToolbarItemInfo中新增属性:PluginManager.cs中:isFirstRegistration && itemInfo.AutoAddToActiveConfig判定是否自动入栏。FlushPendingToolbarRebuild),同时支持白板工具栏与浮动工具栏,避免插件热加载/批量加载时频繁重建引发界面闪烁。2. 设置中心导航栏插件图标自适应渲染
SettingsWindow.xaml.cs中实现CreatePluginNavItemIcon:manifest.json中的Icon配置。icon_mono.png或icon.png。BitmapIcon(ShowAsMonochrome = true)展示,保持 Fluent 整体视觉协调;若均未提供,安全回退到默认齿轮图标。验证情况 (Verification)
AutoAddToActiveConfig = false的插件组件首次加载时,不会强行插入用户的浮动/白板工具栏,同时在“自定义工具栏”管理列表中正常展示供拖拽添加。