mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 16:10:48 +00:00
Merge branch 'master' into randr
Conflicts: ChangeLog
This commit is contained in:
commit
6d4afe9678
3 changed files with 20 additions and 10 deletions
|
@ -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-26 Sergii Stoian <stoyan255@gmail.com>
|
||||
|
||||
* Source/NSWindow.m (sendEvent:): removed usage of extra local variables
|
||||
|
|
|
@ -178,6 +178,15 @@
|
|||
is meant to make things friendlier for slow computers.
|
||||
</p>
|
||||
</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>
|
||||
<desc>
|
||||
<p>
|
||||
|
|
|
@ -2087,16 +2087,12 @@ titleWithRepresentedFilename(NSString *representedFilename)
|
|||
|
||||
- (void) center
|
||||
{
|
||||
NSScreen *screen = [self screen];
|
||||
NSSize screenSize;
|
||||
NSPoint origin = _frame.origin;
|
||||
|
||||
if (screen == nil) {
|
||||
screen = [NSScreen mainScreen];
|
||||
}
|
||||
screenSize = [screen visibleFrame].size;
|
||||
origin.x = (screenSize.width - _frame.size.width) / 2;
|
||||
origin.y = (screenSize.height - _frame.size.height) / 2;
|
||||
NSRect screenFrame = [[NSScreen mainScreen] visibleFrame];
|
||||
NSSize screenSize = screenFrame.size;
|
||||
NSPoint origin = screenFrame.origin;
|
||||
|
||||
origin.x += (screenSize.width - _frame.size.width) / 2;
|
||||
origin.y += (screenSize.height - _frame.size.height) / 2;
|
||||
|
||||
[self setFrameOrigin: origin];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue