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

Unified Diff: chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm

Issue 2068163002: Align the Mac Omnibox items vertically again (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm
diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm
index 2bf381da901a7b6da84306537604f33f2e35c315..eb5289d814b50e554f4b4f3b1337a499e598d591 100644
--- a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm
+++ b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm
@@ -1118,10 +1118,16 @@ NSFont* OmniboxViewMac::GetNormalFieldFont() {
}
NSFont* OmniboxViewMac::GetBoldFieldFont() {
+ // Request a bold font, then make it larger. ResourceBundle will do the
+ // opposite which makes a large system normal font a non-system bold font.
+ // That gives a different baseline to making the non-system bold font larger.
+ // And while the omnibox locks the baseline in ApplyTextStyle(),
+ // OmniboxPopupCellData does not.
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
return rb
- .GetFontWithDelta(kOmniboxNormalFontSizeDelta, gfx::Font::NORMAL,
- gfx::Font::Weight::BOLD)
+ .GetFontWithDelta(0, gfx::Font::NORMAL, gfx::Font::Weight::BOLD)
+ .Derive(kOmniboxNormalFontSizeDelta, gfx::Font::NORMAL,
+ gfx::Font::Weight::BOLD)
.GetNativeFont();
}
« 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