summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorchocobo@chromium.org <chocobo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-19 23:48:12 +0000
committerchocobo@chromium.org <chocobo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-19 23:48:12 +0000
commit3c30891915a40bac4cee93a6dc9246cf1e8d9c95 (patch)
tree32044d3196735a4abf1b5533776868de072c9899 /app
parentba388887c335ee6e1c7ef1ff065aa550ad1bd9bf (diff)
downloadchromium_src-3c30891915a40bac4cee93a6dc9246cf1e8d9c95.zip
chromium_src-3c30891915a40bac4cee93a6dc9246cf1e8d9c95.tar.gz
chromium_src-3c30891915a40bac4cee93a6dc9246cf1e8d9c95.tar.bz2
New network menu button UI for ChromeOS.
Added ability to change label font in gtk menu item. TEST=none BUG=none Review URL: http://codereview.chromium.org/650074 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39516 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app')
-rw-r--r--app/menus/menu_model.h10
-rw-r--r--app/resource_bundle.cc6
-rw-r--r--app/resource_bundle.h4
3 files changed, 19 insertions, 1 deletions
diff --git a/app/menus/menu_model.h b/app/menus/menu_model.h
index 718f3b1..6a522d7 100644
--- a/app/menus/menu_model.h
+++ b/app/menus/menu_model.h
@@ -11,6 +11,12 @@
class SkBitmap;
+namespace gfx {
+
+class Font;
+
+} // namespace gfx
+
namespace menus {
class Accelerator;
@@ -59,6 +65,10 @@ class MenuModel {
// menu item will be updated each time the menu is shown.
virtual bool IsLabelDynamicAt(int index) const = 0;
+ // Returns the font use for the label at the specified index.
+ // If NULL, then use default font.
+ virtual const gfx::Font* GetLabelFontAt(int index) const { return NULL; }
+
// Gets the acclerator information for the specified index, returning true if
// there is a shortcut accelerator for the item, false otherwise.
virtual bool GetAcceleratorAt(int index,
diff --git a/app/resource_bundle.cc b/app/resource_bundle.cc
index 9d9eb21..f0b9923 100644
--- a/app/resource_bundle.cc
+++ b/app/resource_bundle.cc
@@ -146,6 +146,10 @@ void ResourceBundle::LoadFontsIfNecessary() {
if (!base_font_.get()) {
base_font_.reset(new gfx::Font());
+ bold_font_.reset(new gfx::Font());
+ *bold_font_ =
+ base_font_->DeriveFont(0, base_font_->style() | gfx::Font::BOLD);
+
small_font_.reset(new gfx::Font());
*small_font_ = base_font_->DeriveFont(-2);
@@ -164,6 +168,8 @@ void ResourceBundle::LoadFontsIfNecessary() {
const gfx::Font& ResourceBundle::GetFont(FontStyle style) {
LoadFontsIfNecessary();
switch (style) {
+ case BoldFont:
+ return *bold_font_;
case SmallFont:
return *small_font_;
case MediumFont:
diff --git a/app/resource_bundle.h b/app/resource_bundle.h
index 2efd932..a76a426 100644
--- a/app/resource_bundle.h
+++ b/app/resource_bundle.h
@@ -53,10 +53,11 @@ class ResourceBundle {
public:
// An enumeration of the various font styles used throughout Chrome.
// The following holds true for the font sizes:
- // Small <= Base <= Medium <= MediumBold <= Large.
+ // Small <= Base <= Bold <= Medium <= MediumBold <= Large.
enum FontStyle {
SmallFont,
BaseFont,
+ BoldFont,
MediumFont,
// NOTE: depending upon the locale, this may *not* result in a bold font.
MediumBoldFont,
@@ -219,6 +220,7 @@ class ResourceBundle {
// The various fonts used. Cached to avoid repeated GDI creation/destruction.
scoped_ptr<gfx::Font> base_font_;
+ scoped_ptr<gfx::Font> bold_font_;
scoped_ptr<gfx::Font> small_font_;
scoped_ptr<gfx::Font> medium_font_;
scoped_ptr<gfx::Font> medium_bold_font_;