macos NSWindow Mac App Store 类似标题栏

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4586721/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 07:32:29  来源:igfitidea点击:

NSWindow Mac App Store like Title Bar

cocoamacosnswindow

提问by Joshua

How could I make an NSWindow's title bar look like that of the Mac App Store or of the app Feeder where it's height is increased and other controls are show in it.

我怎样才能使NSWindow的标题栏看起来像 Mac App Store 或应用程序 Feeder 的标题栏,其中它的高度增加并且其他控件显示在其中。

To see what I mean just check out the website for the Mac App Store : http://www.apple.com/mac/app-store/.

要了解我的意思,只需查看 Mac App Store 的网站:http: //www.apple.com/mac/app-store/

Is it a custom NSWindowor is it a completely borderless window with an NSViewmade to look like the title bar?

它是自定义的NSWindow还是完全无边框的窗口,NSView看起来像标题栏?

回答by afriend

https://github.com/indragiek/INAppStoreWindow

https://github.com/indragiek/INAppStoreWindow

Title bar and traffic light customization for NSWindow

INAppStoreWindowis an NSWindow subclass that was originally developed to mimic the appearance of the main window in the Mac App Store application introduced in OS X 10.6.6.

The MAS application has since transitioned away from this design, but INAppStoreWindowis still being actively developed to provide extensive additional customization options for NSWindowtitle bars...

NSWindow 的标题栏和交通灯自定义

INAppStoreWindow是一个 NSWindow 子类,最初开发用于模仿 OS X 10.6.6 中引入的 Mac App Store 应用程序中主窗口的外观。

MAS 应用程序已经脱离了这种设计,但INAppStoreWindow仍在积极开发中,为NSWindow标题栏提供广泛的附加自定义选项......

回答by Regexident

For iTunes (v9.x) Apple used no toolbar, but custom aligned icons and controls in the top bar, to achieve a similar effect. (see link below)

对于 iTunes (v9.x) Apple 没有使用工具栏,而是在顶部栏中自定义对齐的图标和控件,以实现类似的效果。(见下面的链接)

The window looks like a "textured & unified title and toolbar" window to me. (or a slight variant of such)

对我来说,该窗口看起来像一个“纹理统一的标题和工具栏”窗口。(或此类的轻微变体)

To reposition the traffic light buttons follow my answer to this question.

要重新定位交通灯按钮,请按照我对这个问题的回答

However, as Dave DeLong already (similarly) commented: "The UI is terrible. Please don't even think about it."

然而,正如 Dave DeLong 已经(类似地)评论的那样:“用户界面很糟糕。请不要考虑它。

回答by James Williams

You can also take a look at http://orestis.gr/blog/2007/09/24/messing-with-windows/. This uses some undocumented stuff, though, so it won't actually get approved FOR the App Store.

您还可以查看http://orestis.gr/blog/2007/09/24/messing-with-windows/。但是,这使用了一些未记录的内容,因此它实际上不会获得 App Store 的批准。