refactor: convert C++ enums to C++11 enum classes (#18087)
This commit is contained in:
parent
a59dc56fa6
commit
c25c31e018
36 changed files with 199 additions and 204 deletions
|
@ -157,7 +157,7 @@ bool ScopedDisableResize::disable_resize_ = false;
|
|||
|
||||
- (void)performClose:(id)sender {
|
||||
if (shell_->title_bar_style() ==
|
||||
atom::NativeWindowMac::CUSTOM_BUTTONS_ON_HOVER) {
|
||||
atom::NativeWindowMac::TitleBarStyle::CUSTOM_BUTTONS_ON_HOVER) {
|
||||
[[self delegate] windowShouldClose:self];
|
||||
} else if (shell_->IsSimpleFullScreen()) {
|
||||
if ([[self delegate] respondsToSelector:@selector(windowShouldClose:)]) {
|
||||
|
@ -182,7 +182,7 @@ bool ScopedDisableResize::disable_resize_ = false;
|
|||
|
||||
- (void)performMiniaturize:(id)sender {
|
||||
if (shell_->title_bar_style() ==
|
||||
atom::NativeWindowMac::CUSTOM_BUTTONS_ON_HOVER)
|
||||
atom::NativeWindowMac::TitleBarStyle::CUSTOM_BUTTONS_ON_HOVER)
|
||||
[self miniaturize:self];
|
||||
else
|
||||
[super performMiniaturize:sender];
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
#include "ui/views/widget/native_widget_mac.h"
|
||||
#include "ui/views_bridge_mac/bridged_native_widget_impl.h"
|
||||
|
||||
using TitleBarStyle = atom::NativeWindowMac::TitleBarStyle;
|
||||
|
||||
@implementation AtomNSWindowDelegate
|
||||
|
||||
- (id)initWithShell:(atom::NativeWindowMac*)shell {
|
||||
|
@ -181,7 +183,7 @@
|
|||
shell_->SetResizable(true);
|
||||
// Hide the native toolbar before entering fullscreen, so there is no visual
|
||||
// artifacts.
|
||||
if (shell_->title_bar_style() == atom::NativeWindowMac::HIDDEN_INSET) {
|
||||
if (shell_->title_bar_style() == TitleBarStyle::HIDDEN_INSET) {
|
||||
NSWindow* window = shell_->GetNativeWindow().GetNativeNSWindow();
|
||||
[window setToolbar:nil];
|
||||
}
|
||||
|
@ -198,14 +200,14 @@
|
|||
// FIXME(zcbenz): Showing titlebar for hiddenInset window is weird under
|
||||
// fullscreen mode.
|
||||
// Show title if fullscreen_window_title flag is set
|
||||
(shell_->title_bar_style() != atom::NativeWindowMac::HIDDEN_INSET ||
|
||||
(shell_->title_bar_style() != TitleBarStyle::HIDDEN_INSET ||
|
||||
shell_->fullscreen_window_title())) {
|
||||
[window setTitleVisibility:NSWindowTitleVisible];
|
||||
}
|
||||
|
||||
// Restore the native toolbar immediately after entering fullscreen, if we
|
||||
// do this before leaving fullscreen, traffic light buttons will be jumping.
|
||||
if (shell_->title_bar_style() == atom::NativeWindowMac::HIDDEN_INSET) {
|
||||
if (shell_->title_bar_style() == TitleBarStyle::HIDDEN_INSET) {
|
||||
base::scoped_nsobject<NSToolbar> toolbar(
|
||||
[[NSToolbar alloc] initWithIdentifier:@"titlebarStylingToolbar"]);
|
||||
[toolbar setShowsBaselineSeparator:NO];
|
||||
|
@ -222,13 +224,13 @@
|
|||
// Restore the titlebar visibility.
|
||||
NSWindow* window = shell_->GetNativeWindow().GetNativeNSWindow();
|
||||
if ((shell_->transparent() || !shell_->has_frame()) &&
|
||||
(shell_->title_bar_style() != atom::NativeWindowMac::HIDDEN_INSET ||
|
||||
(shell_->title_bar_style() != TitleBarStyle::HIDDEN_INSET ||
|
||||
shell_->fullscreen_window_title())) {
|
||||
[window setTitleVisibility:NSWindowTitleHidden];
|
||||
}
|
||||
|
||||
// Turn off the style for toolbar.
|
||||
if (shell_->title_bar_style() == atom::NativeWindowMac::HIDDEN_INSET) {
|
||||
if (shell_->title_bar_style() == TitleBarStyle::HIDDEN_INSET) {
|
||||
shell_->SetStyleMask(false, NSWindowStyleMaskFullSizeContentView);
|
||||
[window setTitlebarAppearsTransparent:YES];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue