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

Side by Side 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: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #import "remoting/host/disconnect_window_mac.h" 7 #import "remoting/host/disconnect_window_mac.h"
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 if ([self isRToL]) { 148 if ([self isRToL]) {
149 // Handle right to left case 149 // Handle right to left case
150 CGFloat buttonInset = NSWidth(windowFrame) - NSMaxX(disconnectFrame); 150 CGFloat buttonInset = NSWidth(windowFrame) - NSMaxX(disconnectFrame);
151 CGFloat buttonTextSpacing 151 CGFloat buttonTextSpacing
152 = NSMinX(disconnectFrame) - NSMaxX(connectedToFrame); 152 = NSMinX(disconnectFrame) - NSMaxX(connectedToFrame);
153 disconnectFrame.origin.x = buttonInset; 153 disconnectFrame.origin.x = buttonInset;
154 connectedToFrame.origin.x = NSMaxX(disconnectFrame) + buttonTextSpacing; 154 connectedToFrame.origin.x = NSMaxX(disconnectFrame) + buttonTextSpacing;
155 [connectedToField_ setFrame:connectedToFrame]; 155 [connectedToField_ setFrame:connectedToFrame];
156 [disconnectButton_ setFrame:disconnectFrame]; 156 [disconnectButton_ setFrame:disconnectFrame];
157 } 157 }
158
159 // Center the window at the bottom of the screen, above the dock (if present).
160 NSRect desktop_rect = [[NSScreen mainScreen] visibleFrame];
161 NSRect window_rect = [[self window] frame];
162 int x = (desktop_rect.size.width - window_rect.size.width) / 2;
dmac 2011/11/22 05:42:06 Please use objective C naming in objective c files
163 int y = desktop_rect.origin.y;
164 [[self window] setFrameOrigin:NSMakePoint(x, y)];
158 } 165 }
159 166
160 - (void)windowWillClose:(NSNotification*)notification { 167 - (void)windowWillClose:(NSNotification*)notification {
161 [self stopSharing:self]; 168 [self stopSharing:self];
162 [self autorelease]; 169 [self autorelease];
163 } 170 }
164 171
165 @end 172 @end
166 173
167 174
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 path = [NSBezierPath bezierPath]; 285 path = [NSBezierPath bezierPath];
279 [path moveToPoint:top]; 286 [path moveToPoint:top];
280 [path lineToPoint:bottom]; 287 [path lineToPoint:bottom];
281 [light setStroke]; 288 [light setStroke];
282 [path stroke]; 289 [path stroke];
283 290
284 [context setShouldAntialias:alias]; 291 [context setShouldAntialias:alias];
285 } 292 }
286 293
287 @end 294 @end
OLDNEW
« 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