主 NSWindow 阴影不会像子窗口那样改变
我的应用程序中的主窗口是无边框的:
[self.window setStyleMask:NSBorderlessWindowMask];
从该窗口,我还打开其他子窗口。当我在其他子窗口之间单击时,我看到当该子窗口被单击并成为焦点窗口时,这些子窗口的阴影变得更暗/更大。但是,我的主窗口的阴影在失去或获得焦点时不会改变。因此,没有太多用户反馈告诉他们原来的主窗口再次成为焦点。
我是否需要重写无边框窗口子类中的某些内容才能启用阴影更改?它有一个阴影,当该窗口成为焦点时,它只是不会变暗/变大。
The primary window in my app is borderless:
[self.window setStyleMask:NSBorderlessWindowMask];
From that window, I also open other child windows. When I click around between those other child windows I see the drop shadow of those child windows get darker/larger when that child window gets clicked and becomes the focused window. However, my main window's shadow doesn't change when it loses or gains focus. So, there isn't much user feedback to tell them that original primary window has become the focus again.
Do I need to override something in my borderless window subclass to enable the shadow changes? It has a shadow, it just doesn't get darker/larger when that window is the focus.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
较暗的阴影是与
NSTitledWindowMask
相关的行为,因此我不相信您实际上可以使用NSBorderlessWindowMask
获得此效果。The darker shadow is a behavior tied to the
NSTitledWindowMask
so I don't believe that you can actually get this using theNSBorderlessWindowMask
.