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

Unified Diff: chrome/browser/autocomplete/autocomplete_popup_view_mac.mm

Issue 3017055: Merge 54767 - [Mac] M6 Omnibox positioning changes.... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/472/src/
Patch Set: Created 10 years, 5 months 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 | chrome/browser/cocoa/location_bar/image_decoration.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/autocomplete_popup_view_mac.mm
===================================================================
--- chrome/browser/autocomplete/autocomplete_popup_view_mac.mm (revision 54836)
+++ chrome/browser/autocomplete/autocomplete_popup_view_mac.mm (working copy)
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <cmath>
+
#include "chrome/browser/autocomplete/autocomplete_popup_view_mac.h"
#include "app/resource_bundle.h"
@@ -26,7 +28,7 @@
// How much to adjust the cell sizing up from the default determined
// by the font.
-const int kCellHeightAdjust = 7.0;
+const int kCellHeightAdjust = 6.0;
// How to round off the popup's corners. Goal is to match star and go
// buttons.
@@ -43,7 +45,7 @@
const CGFloat kImageXOffset = 4.0;
// How far to offset the text column from the left.
-const CGFloat kTextXOffset = 26.0;
+const CGFloat kTextXOffset = 27.0;
// Animation duration when animating the popup window smaller.
const NSTimeInterval kShrinkAnimationDuration = 0.1;
@@ -65,11 +67,6 @@
// borders.
const CGFloat kWindowBorderWidth = 1.0;
-// |AutocompleteButtonCell| and |AutocompleteTextFieldCell| draw their
-// text somewhat differently. The image needs to be adjusted slightly
-// downward to align with the text the same.
-const CGFloat kImageBaselineAdjust = 1.0;
-
// Background colors for different states of the popup elements.
NSColor* BackgroundColor() {
return [[NSColor controlBackgroundColor] colorWithAlphaComponent:kPopupAlpha];
@@ -519,8 +516,8 @@
if (image) {
NSRect imageRect = cellFrame;
imageRect.size = [image size];
- imageRect.origin.y += kImageBaselineAdjust +
- floor((NSHeight(cellFrame) - NSHeight(imageRect)) / 2);
+ imageRect.origin.y +=
+ std::floor((NSHeight(cellFrame) - NSHeight(imageRect)) / 2.0);
imageRect.origin.x += kImageXOffset;
[image drawInRect:imageRect
fromRect:NSZeroRect // Entire image
« no previous file with comments | « no previous file | chrome/browser/cocoa/location_bar/image_decoration.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698