Tighten the scope searched for sub views
This commit is contained in:
parent
b6f9080486
commit
8bef718c9a
1 changed files with 4 additions and 4 deletions
|
|
@ -3280,9 +3280,9 @@ @implementation NSView (FindByIdentifier)
|
|||
static
|
||||
void clear_title_bar_background_views(NSWindow *window) {
|
||||
#define tag @"kitty-for-transparent-titlebar"
|
||||
NSView *contentView = window.contentView, *titlebarContainer = contentView ? contentView.superview : nil;
|
||||
if (titlebarContainer) {
|
||||
for (NSView *subview in [titlebarContainer viewsWithIdentifier:tag]) [subview removeFromSuperview];
|
||||
NSView *contentView = window.contentView;
|
||||
if (contentView) {
|
||||
for (NSView *subview in [contentView viewsWithIdentifier:tag]) [subview removeFromSuperview];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3290,7 +3290,7 @@ void clear_title_bar_background_views(NSWindow *window) {
|
|||
set_title_bar_background(NSWindow *window, NSColor *backgroundColor) {
|
||||
NSView *contentView = window.contentView, *titlebarContainer = contentView ? contentView.superview : nil;
|
||||
if (!titlebarContainer) return;
|
||||
for (NSView *subview in [titlebarContainer viewsWithIdentifier:tag]) [subview removeFromSuperview];
|
||||
for (NSView *subview in [contentView viewsWithIdentifier:tag]) [subview removeFromSuperview];
|
||||
if (!backgroundColor) return;
|
||||
|
||||
const CGFloat height = title_bar_and_tool_bar_height(window);
|
||||
|
|
|
|||
Loading…
Reference in a new issue