mirror of
https://github.com/transmission/transmission
synced 2025-01-30 19:03:04 +00:00
Use screen.visibleFrame instead of screen.frame (#6321)
* Use screen.visibleFrame instead of screen.frame NSScreen.frame does not account for the dock, which can be at the bottom or any of the sides. As a result, layout errors that smash things into the dock can occur in the Y or X direction. visibleFrame accounts for the dock. Should fix #4779. Untested. * Update TorrentTableView.mm * Remove -= 50 in max height calculation
This commit is contained in:
parent
4b882b1bad
commit
e951ed2508
2 changed files with 3 additions and 6 deletions
|
@ -3351,7 +3351,7 @@ void onTorrentCompletenessChanged(tr_torrent* tor, tr_completeness status, bool
|
|||
NSView* senderView = sender;
|
||||
CGFloat width = NSWidth(senderView.frame);
|
||||
|
||||
if (NSMinX(self.fWindow.frame) < width || NSMaxX(self.fWindow.screen.frame) - NSMinX(self.fWindow.frame) < width * 2)
|
||||
if (NSMinX(self.fWindow.frame) < width || NSMaxX(self.fWindow.screen.visibleFrame) - NSMinX(self.fWindow.frame) < width * 2)
|
||||
{
|
||||
// Ugly hack to hide NSPopover arrow.
|
||||
self.fPositioningView = [[NSView alloc] initWithFrame:senderView.bounds];
|
||||
|
@ -5288,13 +5288,10 @@ void onTorrentCompletenessChanged(tr_torrent* tor, tr_completeness status, bool
|
|||
NSScreen* screen = self.fWindow.screen;
|
||||
if (screen)
|
||||
{
|
||||
NSSize maxSize = screen.frame.size;
|
||||
NSSize maxSize = screen.visibleFrame.size;
|
||||
maxSize.height -= self.toolbarHeight;
|
||||
maxSize.height -= self.mainWindowComponentHeight;
|
||||
|
||||
//add a small buffer
|
||||
maxSize.height -= 50;
|
||||
|
||||
if (height > maxSize.height)
|
||||
{
|
||||
height = maxSize.height;
|
||||
|
|
|
@ -877,7 +877,7 @@ static NSTimeInterval const kToggleProgressSeconds = 0.175;
|
|||
|
||||
CGFloat width = NSWidth(rect);
|
||||
|
||||
if (NSMinX(self.window.frame) < width || NSMaxX(self.window.screen.frame) - NSMinX(self.window.frame) < 72)
|
||||
if (NSMinX(self.window.frame) < width || NSMaxX(self.window.screen.visibleFrame) - NSMinX(self.window.frame) < 72)
|
||||
{
|
||||
// Ugly hack to hide NSPopover arrow.
|
||||
self.fPositioningView = [[NSView alloc] initWithFrame:rect];
|
||||
|
|
Loading…
Reference in a new issue