Merge branch 'master' of github.com:gnustep/libs-gui into NSFontCollection_branch

This commit is contained in:
Gregory John Casamento 2020-03-02 15:11:34 -05:00
commit bf5d40ea58
3 changed files with 20 additions and 10 deletions

View file

@ -1,3 +1,8 @@
2020-02-28 Sergii Stoian <stoyan255@gmail.com>
* Source/NSWindow.m (center): always center window on main screen -
monitor where user expects to see window.
2020-02-23 Sergii Stoian <stoyan255@gmail.com> 2020-02-23 Sergii Stoian <stoyan255@gmail.com>
* Source/NSWindow.m * Source/NSWindow.m

View file

@ -178,6 +178,15 @@
is meant to make things friendlier for slow computers. is meant to make things friendlier for slow computers.
</p> </p>
</desc> </desc>
<term>GSScaleFactor</term>
<desc>
<p>
A floating point number, <code>1.0</code> by default. Scales
GUI elements by the given factor for high-DPI monitors. DPI
auto-detection on some platforms (only Windows, for now) will
cause the default to appear to change.
</p>
</desc>
<term>GSUnknownFileTool</term> <term>GSUnknownFileTool</term>
<desc> <desc>
<p> <p>

View file

@ -2087,16 +2087,12 @@ titleWithRepresentedFilename(NSString *representedFilename)
- (void) center - (void) center
{ {
NSScreen *screen = [self screen]; NSRect screenFrame = [[NSScreen mainScreen] visibleFrame];
NSSize screenSize; NSSize screenSize = screenFrame.size;
NSPoint origin = _frame.origin; NSPoint origin = screenFrame.origin;
if (screen == nil) { origin.x += (screenSize.width - _frame.size.width) / 2;
screen = [NSScreen mainScreen]; origin.y += (screenSize.height - _frame.size.height) / 2;
}
screenSize = [screen visibleFrame].size;
origin.x = (screenSize.width - _frame.size.width) / 2;
origin.y = (screenSize.height - _frame.size.height) / 2;
[self setFrameOrigin: origin]; [self setFrameOrigin: origin];
} }