Commit fe7d9447 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.
parent c2cef0ea
......@@ -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