Skip to content

feat(ui): FluentIconsMappingGenerator Roslyn 生成器、FIExtension XAML 扩展#1791

Merged
HelloWRC merged 16 commits into
ClassIsland:masterfrom
lrsgzs:develop/v2/fluent-icon-mapping
May 23, 2026
Merged

feat(ui): FluentIconsMappingGenerator Roslyn 生成器、FIExtension XAML 扩展#1791
HelloWRC merged 16 commits into
ClassIsland:masterfrom
lrsgzs:develop/v2/fluent-icon-mapping

Conversation

@lrsgzs

@lrsgzs lrsgzs commented May 4, 2026

Copy link
Copy Markdown
Contributor

这个 Pull Request 做了什么?

本 PR 实现了根据已有图标字体映射文件,通过 IconsMappingGenerator Roslyn 生成器生成 FluentIcons 静态类、FluentIconKind 枚举,LucideIcons 静态类、LucideIconKind 枚举,并实现了 FIExtensionLIExtension XAML 扩展。

其中,FluentIcons 静态类的成员均为 常量字符串FluentIconKind 枚举用于 FIExtension 的 IDE 补全支持。FIExtension XAML 扩展于 ci 命名空间 (http://classisland.tech/schemas/xaml/core) 可用。

技术上,会将 ic_fluent_access_time_20_filled 转换成 AccessTimeFilled 作为成员名称,以获得更短的长度。

使用示例(未作实际变更):

using ClassIsland.Core.Icons;

[HidePageTitle]
[SettingsPageInfo("about", "关于 ClassIsland", FluentIcons.InfoRegular, FluentIcons.InfoFilled, SettingsPageCategory.About)]
public partial class AboutSettingsPage : SettingsPageBase { }
xmlns:ci="http://classisland.tech/schemas/xaml/core"

<controls3:SettingsExpander Header="回声洞" IconSource="{ci:FluentIconSource {ci:FI CommentTextRegular}}" />

Lucide Icon 支持由 @LiPolymer 提供,用法相同。

相关 Issue

检查清单

  • 我已经在本地测试过这个 PR,确保欲实现的功能或修复的问题能正常工作。

@lrsgzs lrsgzs requested review from a team and HelloWRC as code owners May 4, 2026 12:06
Comment thread roslyn/FluentIconsMappingGenerator/GenerateOptions.cs Outdated
@LiPolymer

LiPolymer commented May 5, 2026

Copy link
Copy Markdown
Contributor

在提交 cf65eb3 中, 成员的命名规则改为大驼峰以规避和 C# 关键字或保留字撞车

Lucide 技术细节同 FluentIcon, 不过codepoints表是info.json 转换产物,相关脚本已一并提交

@lrsgzs lrsgzs force-pushed the develop/v2/fluent-icon-mapping branch from 07526ed to 4f6da5b Compare May 5, 2026 15:14
@HelloWRC

Copy link
Copy Markdown
Member

@lrsgzs 这个可以 review 了吗

@HelloWRC HelloWRC merged commit f8412d3 into ClassIsland:master May 23, 2026
1 of 2 checks passed
@HelloWRC

Copy link
Copy Markdown
Member

感谢您的贡献🤝

昔涟 爱

Koharu-Mizuki pushed a commit to Koharu-Mizuki/ClassIsland-RB that referenced this pull request Jun 19, 2026
…lassIsland#1791)

* chore: 添加图标映射json文件

* feat(roslyn): 添加 FluentIconsMapping 生成器

* feat(ui): 实现 FI (Fluent Icon) XAML 扩展,并添加到 ci 命名空间

取缩写是为了避免和 FluentIcon : FontIcon 冲突

* fix: 修复 CodeFactor 格式化错误

Co-authored-by: codefactor-io[bot] <47775046+codefactor-io[bot]@users.noreply.github.com>

* fix: 修改 生成器 System.Text.Json 由 4.7.2 到 6.0.11

* fix: 生成器使用专用Json解码器规避依赖问题

* refactor: 重构生成器以使其可复用

* chore: 添加lucide codepoints映射表及其转换脚本

* refactor: 使源代码注册流程可复用并添加Lucide支持

* fix: 使用大驼峰以规避保留字和关键字

* feat(ui): 实现 Lucide Icon XAML 扩展

* refactor: 重命名生成器项目

* fix: FIExtension summary 错误

* fix: FIExtension summary 错误 x2

* fix: LIExtension summary 错误

* fix: ClassIsland.Core.csproj 排除 lucide.json 资源?

---------

Co-authored-by: codefactor-io[bot] <47775046+codefactor-io[bot]@users.noreply.github.com>
Co-authored-by: LiPolymer <fish@lipoly.ink>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants