Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(423)

Unified Diff: remoting/host/disconnect_window_mac.mm

Issue 8623006: Center the disconnect window at the bottom of the screen. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reviewer comments. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/disconnect_window_mac.mm
diff --git a/remoting/host/disconnect_window_mac.mm b/remoting/host/disconnect_window_mac.mm
index 94ba85508b8779610f00504a3d59058441ed57f2..c3de197136e211f20e4a4e331b90935a87cea432 100644
--- a/remoting/host/disconnect_window_mac.mm
+++ b/remoting/host/disconnect_window_mac.mm
@@ -155,6 +155,13 @@ remoting::DisconnectWindow* remoting::DisconnectWindow::Create() {
[connectedToField_ setFrame:connectedToFrame];
[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 {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698