1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-04 10:38:13 +00:00
transmission/macosx/MainWindow.mm
SweetPPro c3cd9cffad
re-add macOS Fullscreen support (#3261)
* re-add macOS Fullscreen support

re added Full Screen support for macOS. Also refactored window methods in Controller.mm and moved to their own category - ControllerWindowMethods.mm

This has currently only been tested on macOS Monterey, and should be good on earlier versions - but perhaps needs testing on earlier versions of macOS.

fixes #3231 #3234
2022-06-12 19:54:52 -05:00

31 lines
740 B
Text

// This file Copyright © 2008-2022 Transmission authors and contributors.
// It may be used under the MIT (SPDX: MIT) license.
// License text can be found in the licenses/ folder.
#import "MainWindow.h"
#define TOOL_BAR_HEIGHT 28.0
@implementation MainWindow
- (void)toggleToolbarShown:(id)sender
{
NSRect frame = self.frame;
//fix window size and origin when toggling toolbar
if (self.toolbar.isVisible == YES)
{
frame.size.height += TOOL_BAR_HEIGHT;
frame.origin.y -= TOOL_BAR_HEIGHT;
}
else
{
frame.size.height -= TOOL_BAR_HEIGHT;
frame.origin.y += TOOL_BAR_HEIGHT;
}
[self setFrame:frame display:YES animate:NO];
[super toggleToolbarShown:sender];
}
@end