Commit 95870a60 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: allow the user to minimize the main window by double-clicking the...

macosx: allow the user to minimize the main window by double-clicking the window title when using the dark UI variant

This respects the system preferences' global setting.
(cherry picked from commit fe7d94473216228c8f9667e1d476bfc54e771153)
parent 42a8f958
......@@ -240,6 +240,19 @@
else
[o_fullscreen_btn setImage: [NSImage imageNamed:@"window-fullscreen"]];
}
- (void)mouseUp:(NSEvent *)event
{
if ([event clickCount] == 2) {
//Get settings from "System Preferences" > "Appearance" > "Double-click on windows title bar to minimize"
NSString *const MDAppleMiniaturizeOnDoubleClickKey = @"AppleMiniaturizeOnDoubleClick";
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
[userDefaults addSuiteNamed:NSGlobalDomain];
if ([[userDefaults objectForKey:MDAppleMiniaturizeOnDoubleClickKey] boolValue])
[[self window] miniaturize:self];
}
}
@end
/*****************************************************************************
......
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