Center the disconnect window at the bottom of the screen.

BUG=101178
TEST=Manual


Review URL: http://codereview.chromium.org/8623006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111317 0039d316-1c4b-4281-b951-d872f2087c98
parent d744fce3
...@@ -155,6 +155,13 @@ remoting::DisconnectWindow* remoting::DisconnectWindow::Create() { ...@@ -155,6 +155,13 @@ remoting::DisconnectWindow* remoting::DisconnectWindow::Create() {
[connectedToField_ setFrame:connectedToFrame]; [connectedToField_ setFrame:connectedToFrame];
[disconnectButton_ setFrame:disconnectFrame]; [disconnectButton_ setFrame:disconnectFrame];
} }
// Center the window at the bottom of the screen, above the dock (if present).
NSRect desktopRect = [[NSScreen mainScreen] visibleFrame];
NSRect windowRect = [[self window] frame];
CGFloat x = (NSWidth(desktopRect) - NSWidth(windowRect)) / 2;
CGFloat y = NSMinY(desktopRect);
[[self window] setFrameOrigin:NSMakePoint(x, y)];
} }
- (void)windowWillClose:(NSNotification*)notification { - (void)windowWillClose:(NSNotification*)notification {
......
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