Skip to content
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions sources/ToastWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@

#import "ToastWindowController.h"
#import <QuartzCore/QuartzCore.h>
#import "NSAppearance+iTerm.h"
#import "NSColor+iTerm.h"
#import "NSScreen+iTerm.h"
#import "PTYSession.h"
#import "PseudoTerminal.h"
#import "RoundedRectView.h"
#import "iTermController.h"
Expand Down Expand Up @@ -134,12 +137,16 @@ + (void)showToastWithMessage:(NSString *)message duration:(NSInteger)duration sc
}];
maskImage.capInsets = NSEdgeInsetsMake(cornerRadius, cornerRadius, cornerRadius, cornerRadius);

PTYSession *session = [[iTermController sharedInstance] currentTerminal].currentSession;
NSColor *bgColor = session.effectiveUnprocessedBackgroundColor;
BOOL isDark = bgColor ? bgColor.perceivedBrightness < 0.5 : YES;

NSVisualEffectView *vev = [[NSVisualEffectView alloc] initWithFrame:container.bounds];
vev.wantsLayer = YES;
vev.blendingMode = NSVisualEffectBlendingModeBehindWindow;
vev.state = NSVisualEffectStateActive;
vev.material = NSVisualEffectMaterialHUDWindow;
vev.appearance = [NSAppearance appearanceNamed:NSAppearanceNameVibrantDark];
vev.material = isDark ? NSVisualEffectMaterialHUDWindow : NSVisualEffectMaterialSheet;
vev.appearance = [NSAppearance appearanceNamed:isDark ? NSAppearanceNameVibrantDark : NSAppearanceNameVibrantLight];
vev.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
vev.maskImage = maskImage;
[container addSubview:vev];
Expand Down
6 changes: 6 additions & 0 deletions sources/iTermGlobalSearchWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#import "FindContext.h"
#import "iTerm2SharedARC-Swift.h"
#import "iTermController.h"
#import "NSAppearance+iTerm.h"
#import "NSColor+iTerm.h"
#import "iTermFocusReportingTextField.h"
#import "iTermGlobalSearchEngine.h"
#import "iTermGlobalSearchOutlineView.h"
Expand Down Expand Up @@ -58,6 +60,10 @@ - (instancetype)init {
- (void)windowDidLoad {
self.window.delegate = self;
self.window.level = NSFloatingWindowLevel;
PTYSession *session = [[iTermController sharedInstance] currentTerminal].currentSession;
NSColor *bgColor = session.effectiveUnprocessedBackgroundColor;
BOOL isDark = bgColor ? bgColor.perceivedBrightness < 0.5 : [NSAppearance it_appearanceForCurrentTheme].it_isDark;
self.window.appearance = [NSAppearance appearanceNamed:isDark ? NSAppearanceNameDarkAqua : NSAppearanceNameAqua];
[_outlineView expandItem:nil expandChildren:YES];
_panel.becomesKeyOnlyIfNeeded = YES;
[_findType selectItemWithTag:[iTermUserDefaults globalSearchMode]];
Expand Down
9 changes: 9 additions & 0 deletions sources/iTermInstantReplayWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
#import "iTermInstantReplayWindowController.h"

#import "DebugLogging.h"
#import "iTermController.h"
#import "NSAppearance+iTerm.h"
#import "NSColor+iTerm.h"
#import "PTYSession.h"
#import "PseudoTerminal.h"

static const float kAlphaValue = 0.9;

Expand Down Expand Up @@ -138,6 +143,10 @@ - (void)windowDidLoad

self.window.level = NSFloatingWindowLevel;
self.window.alphaValue = kAlphaValue;
PTYSession *session = [[iTermController sharedInstance] currentTerminal].currentSession;
NSColor *bgColor = session.effectiveUnprocessedBackgroundColor;
BOOL isDark = bgColor ? bgColor.perceivedBrightness < 0.5 : [NSAppearance it_appearanceForCurrentTheme].it_isDark;
self.window.appearance = [NSAppearance appearanceNamed:isDark ? NSAppearanceNameDarkAqua : NSAppearanceNameAqua];
}

- (void)windowWillClose:(NSNotification *)notification {
Expand Down
4 changes: 2 additions & 2 deletions sources/iTermOpenQuicklyView.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ - (void)awakeFromNib {
if (@available(macOS 26, *)) {
NSGlassEffectView *glassView = [[NSGlassEffectView alloc] initWithFrame:self.bounds];
_backgroundEffectView = glassView;
glassView.tintColor = [NSColor it_dynamicColorForLightMode:[NSColor colorWithWhite:0.8 alpha:0.7]
darkMode:[NSColor colorWithWhite:0.2 alpha:0.7]];
glassView.tintColor = [NSColor it_dynamicColorForLightMode:[NSColor colorWithWhite:0.95 alpha:0.55]
darkMode:[NSColor colorWithWhite:0.08 alpha:0.88]];
_glassContentView = [[NSView alloc] initWithFrame:_backgroundEffectView.bounds];
glassView.contentView = _glassContentView;
[_container addSubview:_backgroundEffectView];
Expand Down
2 changes: 2 additions & 0 deletions sources/iTermOpenQuicklyWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#import "iTermSessionLauncher.h"
#import "iTermSnippetsMenuController.h"
#import "DebugLogging.h"
#import "NSAppearance+iTerm.h"
#import "NSColor+iTerm.h"
#import "NSObject+iTerm.h"
#import "NSTextField+iTerm.h"
Expand Down Expand Up @@ -141,6 +142,7 @@ - (void)awakeFromNib {
- (void)presentWindow {
[_model removeAllItems];
[_table reloadData];
self.window.appearance = [NSAppearance it_appearanceForCurrentTheme];
// Set the window's frame to be table-less initially.
[self.window setFrame:[self frame] display:YES animate:NO];
[_textField selectText:nil];
Expand Down
4 changes: 4 additions & 0 deletions sources/iTermPopupWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#import "DebugLogging.h"
#import "iTermAdvancedSettingsModel.h"
#import "iTermPreferences.h"
#import "NSAppearance+iTerm.h"
#import "NSObject+iTerm.h"
#import "NSTextField+iTerm.h"
#import "NSView+iTerm.h"
Expand Down Expand Up @@ -161,6 +162,9 @@ - (void)popWithDelegate:(id<PopupDelegate>)delegate

[self.popupWindow setOwningWindow:owningWindow];

BOOL isDark = owningWindow.effectiveAppearance.it_isDark;
self.window.appearance = [NSAppearance appearanceNamed:isDark ? NSAppearanceNameDarkAqua : NSAppearanceNameAqua];

static const NSTimeInterval kAnimationDuration = 0.15;
self.window.alphaValue = 0;
if (delegate.popupWindowIsInFloatingHotkeyWindow) {
Expand Down
Loading