Chromium Code Reviews
DescriptionStart removing enum ui::ResourceBundle::FontStyle, fix MacViews font sizes
SmallFont, MediumFont, etc., are actually no better than magic numbers,
but client code tries to attach some semantic meaning to them. We now
find that uses of, e.g., `BaseFont` can appear too large on one
platform, but we can't simply change the size of `BaseFont` without
breaking a lot of existing UI.
They're also limited, with clients often forced to derive fonts of a
different size to suit mocks, then missing out on all the caching
benefits that ResourceBundle::FontStyle is designed to offer.
This CL adds a more flexible API, with:
- GetFont[List]WithDelta(int, Font::FontStyle)
- An as-needed cache that will cache any combination requested by client
code
- ui/base/default_style.h, with the constants from c/b/chrome_style.h
for recommended sizes for dialog text and dialog titles.
Users of ResourceBundle::FontStyle under ui/ are removed to give an idea
of how this would be used.
Rationale: this fixes font sizes for MacViews (which are too large) without
font sizes unexpectedly changing elsewhere in Cocoa or Views code.
Design doc http://goo.gl/QBT62L
BUG=564879
Committed: https://crrev.com/38da8029333feee3045ce7cd899c540683782980
Cr-Commit-Position: refs/heads/master@{#377477}
Patch Set 1 #Patch Set 2 : Something landable #Patch Set 3 : Changes for Mac #
Total comments: 1
Patch Set 4 : self-review: build upon the old style like LoadFontsIfNecessary did #
Total comments: 8
Patch Set 5 : fix transcription error #
Messages
Total messages: 23 (13 generated)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||