Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

自定义标题栏 #624

Merged
merged 47 commits into from
May 31, 2023
Merged

自定义标题栏 #624

merged 47 commits into from
May 31, 2023

Conversation

Blinue
Copy link
Owner

@Blinue Blinue commented May 20, 2023

系统标题栏的问题:

  1. 过窄,不符合 Fluent Design,图标和文字也不协调。
    image
  2. Win10 和 Win11 的风格不统一。
  3. 在 Win11 下如果用户启用了“在标题栏和窗口边框上显示强调色”标题栏会变为纯色而不是 Mica。
    image

我们需要移除系统标题栏,自己实现它。实现一个和操作系统完美集成的标题栏非常困难,但幸好我们只需要支持 Win10 和 Win11,这大大降低了复杂度。我们也有开源项目可以参考:

  • Windows Termial 的标题栏实现的很好,技术栈也和我们相同,因此有很大的参考性。它最主要的问题是调整窗口大小时会露出原始标题栏,十分丑陋。
    image

  • framelesshelper 实现了几乎完美的标题栏,它包含了大量的 hack,值得参考。

最终我希望达到和 UWP 相同的效果,UWP(Application Frame Host)有着目前最完美的标题栏实现,而最新的 WinUI 3 则不忍直视😅当然无论如何 microsoft/microsoft-ui-xaml#759 是无法在应用层修复的(WinUI 3 也没有修复)。

Tamarahill

This comment was marked as spam.

@Blinue Blinue marked this pull request as draft May 21, 2023 06:58
@Blinue
Copy link
Owner Author

Blinue commented May 29, 2023

2023-05-29.190224.mp4

@Blinue
Copy link
Owner Author

Blinue commented May 31, 2023

2023-05-31.175312.mp4

@Blinue
Copy link
Owner Author

Blinue commented May 31, 2023

发现了 NavigationView 一个恼人的 bug,导航栏的图标和文字不是对齐的。有一个两年前的 PR:microsoft/microsoft-ui-xaml#5187 ,这属于微软的传统艺能了。

image

@Blinue Blinue marked this pull request as ready for review May 31, 2023 11:30
@Blinue
Copy link
Owner Author

Blinue commented May 31, 2023

完美😎

@Blinue Blinue merged commit 914c683 into dev May 31, 2023
1 check passed
@Blinue Blinue deleted the frameless branch May 31, 2023 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants