Commit d8cc4739 authored by Leonard Grey's avatar Leonard Grey Committed by Commit Bot

Mac: update first run dialogue for dark mode

Bug: 939251
Change-Id: Ifbb8384ce97adaf68a32264aa575883886114e7c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1508573
Commit-Queue: Leonard Grey <lgrey@chromium.org>
Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#638661}
parent e63169ed
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "chrome/browser/ui/cocoa/first_run_dialog_controller.h" #include "chrome/browser/ui/cocoa/first_run_dialog_controller.h"
#include "base/mac/scoped_nsobject.h" #include "base/mac/scoped_nsobject.h"
#include "base/mac/sdk_forward_declarations.h"
#include "chrome/browser/ui/cocoa/key_equivalent_constants.h" #include "chrome/browser/ui/cocoa/key_equivalent_constants.h"
#include "chrome/browser/ui/cocoa/l10n_util.h" #include "chrome/browser/ui/cocoa/l10n_util.h"
#include "chrome/grit/chromium_strings.h" #include "chrome/grit/chromium_strings.h"
...@@ -65,9 +66,24 @@ void CenterVertically(NSView* view) { ...@@ -65,9 +66,24 @@ void CenterVertically(NSView* view) {
} }
- (void)loadView { - (void)loadView {
BOOL isDarkMode = NO;
if (@available(macOS 10.14, *)) {
NSAppearanceName appearance =
[[NSApp effectiveAppearance] bestMatchFromAppearancesWithNames:@[
NSAppearanceNameAqua, NSAppearanceNameDarkAqua
]];
isDarkMode = [appearance isEqual:NSAppearanceNameDarkAqua];
}
NSColor* topBoxColor = isDarkMode
? [NSColor colorWithCalibratedRed:0x32 / 255.0
green:0x36 / 255.0
blue:0x39 / 255.0
alpha:1.0]
: [NSColor whiteColor];
NSBox* topBox = NSBox* topBox =
[[[NSBox alloc] initWithFrame:NSMakeRect(0, 137, 480, 52)] autorelease]; [[[NSBox alloc] initWithFrame:NSMakeRect(0, 137, 480, 52)] autorelease];
[topBox setFillColor:[NSColor whiteColor]]; [topBox setFillColor:topBoxColor];
[topBox setBoxType:NSBoxCustom]; [topBox setBoxType:NSBoxCustom];
[topBox setBorderType:NSNoBorder]; [topBox setBorderType:NSNoBorder];
[topBox setContentViewMargins:NSZeroSize]; [topBox setContentViewMargins:NSZeroSize];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment