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

Issue 1689623004: Start removing enum ui::ResourceBundle::FontStyle, fix MacViews font sizes (Closed)

Created:
4 years, 10 months ago by tapted
Modified:
4 years, 10 months ago
CC:
chromium-reviews, tfarina, msw+watch_chromium.org, groby+bubble_chromium.org, hcarmona+bubble_chromium.org, rouslan+bubble_chromium.org, chrome-apps-syd-reviews_chromium.org, sky
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Start 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+184 lines, -97 lines) Patch
M ui/base/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download
M ui/base/cocoa/controls/blue_label_button.mm View 2 chunks +3 lines, -2 lines 0 comments Download
M ui/base/cocoa/menu_controller_unittest.mm View 1 chunk +3 lines, -2 lines 0 comments Download
A ui/base/default_style.h View 1 2 1 chunk +40 lines, -0 lines 0 comments Download
M ui/base/resource/resource_bundle.h View 1 4 chunks +26 lines, -23 lines 0 comments Download
M ui/base/resource/resource_bundle.cc View 1 2 3 4 chunks +61 lines, -52 lines 0 comments Download
M ui/base/ui_base.gyp View 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/bubble/bubble_delegate.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M ui/views/bubble/bubble_frame_view.cc View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M ui/views/controls/combobox/combobox.cc View 1 2 chunks +2 lines, -1 line 0 comments Download
M ui/views/controls/label.cc View 1 2 2 chunks +12 lines, -4 lines 0 comments Download
M ui/views/controls/tabbed_pane/tabbed_pane.cc View 1 2 3 4 4 chunks +16 lines, -6 lines 0 comments Download
M ui/views/controls/textfield/textfield.cc View 1 2 3 chunks +8 lines, -0 lines 0 comments Download
M ui/views/widget/widget.cc View 1 2 chunks +7 lines, -4 lines 0 comments Download

Messages

Total messages: 23 (13 generated)
tapted
Hi sky, please take a look I actually put together a design doc for this ...
4 years, 10 months ago (2016-02-24 08:13:29 UTC) #7
sky
I'm a bit overwhelmed with other big changes of late, as well as taking over ...
4 years, 10 months ago (2016-02-24 18:33:27 UTC) #9
Ben Goodger (Google)
This seems like a good improvement for specificity. lgtm
4 years, 10 months ago (2016-02-24 18:42:24 UTC) #10
msw
Drive by q and nit; otherwise lgtm https://codereview.chromium.org/1689623004/diff/60001/ui/base/resource/resource_bundle.cc File ui/base/resource/resource_bundle.cc (right): https://codereview.chromium.org/1689623004/diff/60001/ui/base/resource/resource_bundle.cc#newcode546 ui/base/resource/resource_bundle.cc:546: gfx::FontList& base ...
4 years, 10 months ago (2016-02-24 19:28:07 UTC) #12
tfarina
https://codereview.chromium.org/1689623004/diff/60001/ui/base/default_style.h File ui/base/default_style.h (right): https://codereview.chromium.org/1689623004/diff/60001/ui/base/default_style.h#newcode10 ui/base/default_style.h:10: // This file contains the constants that provide the ...
4 years, 10 months ago (2016-02-24 20:08:55 UTC) #13
tfarina
https://codereview.chromium.org/1689623004/diff/60001/ui/base/resource/resource_bundle.h File ui/base/resource/resource_bundle.h (right): https://codereview.chromium.org/1689623004/diff/60001/ui/base/resource/resource_bundle.h#newcode249 ui/base/resource/resource_bundle.h:249: gfx::Font::FontStyle style = gfx::Font::NORMAL); is default parameters now allowed? ...
4 years, 10 months ago (2016-02-24 20:39:24 UTC) #15
tapted
https://codereview.chromium.org/1689623004/diff/60001/ui/base/default_style.h File ui/base/default_style.h (right): https://codereview.chromium.org/1689623004/diff/60001/ui/base/default_style.h#newcode10 ui/base/default_style.h:10: // This file contains the constants that provide the ...
4 years, 10 months ago (2016-02-25 00:21:11 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1689623004/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1689623004/80001
4 years, 10 months ago (2016-02-25 02:39:40 UTC) #19
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 10 months ago (2016-02-25 02:51:07 UTC) #21
commit-bot: I haz the power
4 years, 10 months ago (2016-02-25 02:51:53 UTC) #23
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/38da8029333feee3045ce7cd899c540683782980
Cr-Commit-Position: refs/heads/master@{#377477}

Powered by Google App Engine
This is Rietveld 408576698