|
@@ -863,8 +863,7 @@ void NativeWindowMac::SetResizable(bool resizable) {
|
|
|
// the maximize button and ensure fullscreenability matches user setting.
|
|
|
SetCanResize(resizable);
|
|
|
SetFullScreenable(was_fullscreenable);
|
|
|
- [[window_ standardWindowButton:NSWindowZoomButton]
|
|
|
- setEnabled:resizable ? was_fullscreenable : false];
|
|
|
+ UpdateZoomButton();
|
|
|
}
|
|
|
|
|
|
bool NativeWindowMac::IsResizable() {
|
|
@@ -892,19 +891,26 @@ bool NativeWindowMac::IsMinimizable() {
|
|
|
|
|
|
void NativeWindowMac::SetMaximizable(bool maximizable) {
|
|
|
maximizable_ = maximizable;
|
|
|
- [[window_ standardWindowButton:NSWindowZoomButton] setEnabled:maximizable];
|
|
|
+ UpdateZoomButton();
|
|
|
}
|
|
|
|
|
|
bool NativeWindowMac::IsMaximizable() {
|
|
|
return [[window_ standardWindowButton:NSWindowZoomButton] isEnabled];
|
|
|
}
|
|
|
|
|
|
+void NativeWindowMac::UpdateZoomButton() {
|
|
|
+ [[window_ standardWindowButton:NSWindowZoomButton]
|
|
|
+ setEnabled:IsResizable() && (CanMaximize() || IsFullScreenable())];
|
|
|
+}
|
|
|
+
|
|
|
void NativeWindowMac::SetFullScreenable(bool fullscreenable) {
|
|
|
SetCollectionBehavior(fullscreenable,
|
|
|
NSWindowCollectionBehaviorFullScreenPrimary);
|
|
|
// On EL Capitan this flag is required to hide fullscreen button.
|
|
|
SetCollectionBehavior(!fullscreenable,
|
|
|
NSWindowCollectionBehaviorFullScreenAuxiliary);
|
|
|
+
|
|
|
+ UpdateZoomButton();
|
|
|
}
|
|
|
|
|
|
bool NativeWindowMac::IsFullScreenable() {
|