适用于 macOS 的 Xcode 风格工具栏 SwiftUI
我正在为一个名为 CodeEdit 的项目做出贡献,该项目旨在制作一个设计类似于 Xcode 的代码编辑器。在黑暗模式下,我无法使工具栏颜色与 Xcode 黑暗模式下的工具栏颜色相同,它在黑暗模式下始终为黑色。下面的视频显示了正在发生的事情。所有代码均位于 https://github.com/highjeans/CodeEdit 中。我查看了 使用 Swift UI 自定义 macOS 工具栏,但这不是我需要什么。我还查看了 SwiftUI macOS Xcode Style Toolbar 但这更多是类似于 Notes 的东西不是Xcode。
https://drive.google.com/file/d/185LQCeiVwSub8GIj19f6svUTHa7hsBCL/ view?usp=sharing
编辑:我得到了工作的颜色,我不知道如何更改选项卡栏下的白色背景: 工作工具栏颜色的图片< /a>
I am contributing to a project called CodeEdit, which is looking to make a code editor with a design similar to Xcode. In dark mode, I can't get the toolbar color to be the same as the toolbar in Xcode dark mode, it is always black in dark mode. The video below shows what is happening. All code is in https://github.com/highjeans/CodeEdit. I looked at Customizing the macOS toolbar with Swift UI but that is not what I need. I also looked at SwiftUI macOS Xcode Style Toolbar but that is more for something similar to Notes not Xcode.
https://drive.google.com/file/d/185LQCeiVwSub8GIj19f6svUTHa7hsBCL/view?usp=sharing
Edit: I got the color to work, I don't know how to change the white background under the Tab Bar: Picture of sort of working toolbar color
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我通过改变有史以来最随机的线来让它工作。如果您正在寻找类似于 Xcode 的工具栏颜色,请将 NSWindow.titlebarSeparatorStyle 更改为 .line。
I got it working by changing the most random line ever. If you are looking for a toolbar color similar to Xcode, change NSWindow.titlebarSeparatorStyle to .line.