mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-27 18:51:41 +02:00
Tighten the scope searched for sub views
This commit is contained in:
@@ -3280,9 +3280,9 @@ title_bar_and_tool_bar_height(NSWindow *window) {
|
|||||||
static
|
static
|
||||||
void clear_title_bar_background_views(NSWindow *window) {
|
void clear_title_bar_background_views(NSWindow *window) {
|
||||||
#define tag @"kitty-for-transparent-titlebar"
|
#define tag @"kitty-for-transparent-titlebar"
|
||||||
NSView *contentView = window.contentView, *titlebarContainer = contentView ? contentView.superview : nil;
|
NSView *contentView = window.contentView;
|
||||||
if (titlebarContainer) {
|
if (contentView) {
|
||||||
for (NSView *subview in [titlebarContainer viewsWithIdentifier:tag]) [subview removeFromSuperview];
|
for (NSView *subview in [contentView viewsWithIdentifier:tag]) [subview removeFromSuperview];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3290,7 +3290,7 @@ static void
|
|||||||
set_title_bar_background(NSWindow *window, NSColor *backgroundColor) {
|
set_title_bar_background(NSWindow *window, NSColor *backgroundColor) {
|
||||||
NSView *contentView = window.contentView, *titlebarContainer = contentView ? contentView.superview : nil;
|
NSView *contentView = window.contentView, *titlebarContainer = contentView ? contentView.superview : nil;
|
||||||
if (!titlebarContainer) return;
|
if (!titlebarContainer) return;
|
||||||
for (NSView *subview in [titlebarContainer viewsWithIdentifier:tag]) [subview removeFromSuperview];
|
for (NSView *subview in [contentView viewsWithIdentifier:tag]) [subview removeFromSuperview];
|
||||||
if (!backgroundColor) return;
|
if (!backgroundColor) return;
|
||||||
|
|
||||||
const CGFloat height = title_bar_and_tool_bar_height(window);
|
const CGFloat height = title_bar_and_tool_bar_height(window);
|
||||||
|
|||||||
Reference in New Issue
Block a user