主NSWindow阴影不会像子窗口那样改变 [英] Main NSWindow shadow doesn't change like child windows

查看:181
本文介绍了主NSWindow阴影不会像子窗口那样改变的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程式中的主要视窗无边框:

  [self.window setStyleMask:NSBorderlessWindowMask]; 

从该窗口,我还打开其他子窗口。当我在那些其他子窗口之间单击时,我看到那些子窗口的下拉阴影变得更暗/更大当该子窗口被点击,并成为焦点窗口。但是,当我失去或获得焦点时,我的主窗口的阴影不会改变。所以,没有太多的用户反馈,告诉他们原来的主窗口已经成为焦点了。



我需要在我的无边框窗口子类中重写一些东西,以启用阴影更改吗?

解决方案

阴影越暗,阴影越亮。一个绑定到 NSTitledWindowMask 的行为,所以我不相信你可以使用 NSBorderlessWindowMask p>

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.

解决方案

The darker shadow is a behavior tied to the NSTitledWindowMask so I don't believe that you can actually get this using the NSBorderlessWindowMask.

这篇关于主NSWindow阴影不会像子窗口那样改变的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆