NSWindow主阴影不会像子窗口一样变化

NSWindow主阴影不会像子窗口一样变化

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

问题描述

应用程序中的主窗口是无边界的:

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.

推荐答案

较暗的阴影是与NSTitledWindowMask关联的行为,因此我不相信您实际上可以使用NSBorderlessWindowMask来获得它.

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主阴影不会像子窗口一样变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 08:25