summaryrefslogtreecommitdiffstats
path: root/views
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 /views
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 'views')
-rw-r--r--views/controls/menu/native_menu_gtk.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/views/controls/menu/native_menu_gtk.cc b/views/controls/menu/native_menu_gtk.cc
index feb7b0c..693570e 100644
--- a/views/controls/menu/native_menu_gtk.cc
+++ b/views/controls/menu/native_menu_gtk.cc
@@ -7,6 +7,7 @@
#include <map>
#include <string>
+#include "app/gfx/font.h"
#include "app/gfx/gtk_util.h"
#include "app/menus/menu_model.h"
#include "base/keyboard_code_conversion_gtk.h"
@@ -231,6 +232,16 @@ GtkWidget* NativeMenuGtk::AddMenuItemAt(int index,
break;
}
+ // Label font.
+ const gfx::Font* font = model_->GetLabelFontAt(index);
+ if (font) {
+ // The label item is the first child of the menu item.
+ GtkWidget* label_widget = GTK_BIN(menu_item)->child;
+ DCHECK(label_widget && GTK_IS_LABEL(label_widget));
+ gtk_widget_modify_font(label_widget,
+ gfx::Font::PangoFontFromGfxFont(*font));
+ }
+
if (type == menus::MenuModel::TYPE_SUBMENU) {
Menu2* submenu = new Menu2(model_->GetSubmenuModelAt(index));
static_cast<NativeMenuGtk*>(submenu->wrapper_.get())->set_parent(this);