diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-29 20:42:16 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-29 20:42:16 +0000 |
commit | db919fa6eeb44814c553256d440250155e0beaa4 (patch) | |
tree | 63745c045d69bebf9f83725e99a9b528fb4b21df | |
parent | d14c7ac0a14a2dc3984022aeadf830a3e30c99f3 (diff) | |
download | chromium_src-db919fa6eeb44814c553256d440250155e0beaa4.zip chromium_src-db919fa6eeb44814c553256d440250155e0beaa4.tar.gz chromium_src-db919fa6eeb44814c553256d440250155e0beaa4.tar.bz2 |
Properly display mnemonics in some gtk menus where they were not being escaped and showed up as &.
Get rid of manual escaping in bookmark context menu gtk.
BUG=12868
Review URL: http://codereview.chromium.org/118024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17228 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/bookmarks/bookmark_context_menu_gtk.cc | 15 | ||||
-rw-r--r-- | chrome/browser/gtk/menu_gtk.cc | 12 |
2 files changed, 12 insertions, 15 deletions
diff --git a/chrome/browser/bookmarks/bookmark_context_menu_gtk.cc b/chrome/browser/bookmarks/bookmark_context_menu_gtk.cc index a60146e..2b2181b 100644 --- a/chrome/browser/bookmarks/bookmark_context_menu_gtk.cc +++ b/chrome/browser/bookmarks/bookmark_context_menu_gtk.cc @@ -15,17 +15,11 @@ void BookmarkContextMenu::CreateMenuObject() { } void BookmarkContextMenu::AppendItem(int id) { - menu_->AppendMenuItemWithLabel( - id, - MenuGtk::ConvertAcceleratorsFromWindowsStyle( - l10n_util::GetStringUTF8(id))); + menu_->AppendMenuItemWithLabel(id, l10n_util::GetStringUTF8(id)); } void BookmarkContextMenu::AppendItem(int id, int localization_id) { - menu_->AppendMenuItemWithLabel( - id, - MenuGtk::ConvertAcceleratorsFromWindowsStyle( - l10n_util::GetStringUTF8(localization_id))); + menu_->AppendMenuItemWithLabel(id, l10n_util::GetStringUTF8(localization_id)); } void BookmarkContextMenu::AppendSeparator() { @@ -33,8 +27,5 @@ void BookmarkContextMenu::AppendSeparator() { } void BookmarkContextMenu::AppendCheckboxItem(int id) { - menu_->AppendCheckMenuItemWithLabel( - id, - MenuGtk::ConvertAcceleratorsFromWindowsStyle( - l10n_util::GetStringUTF8(id))); + menu_->AppendCheckMenuItemWithLabel(id, l10n_util::GetStringUTF8(id)); } diff --git a/chrome/browser/gtk/menu_gtk.cc b/chrome/browser/gtk/menu_gtk.cc index 24abed8..dc1be83 100644 --- a/chrome/browser/gtk/menu_gtk.cc +++ b/chrome/browser/gtk/menu_gtk.cc @@ -42,7 +42,9 @@ void MenuGtk::ConnectSignalHandlers() { void MenuGtk::AppendMenuItemWithLabel(int command_id, const std::string& label) { - GtkWidget* menu_item = gtk_menu_item_new_with_mnemonic(label.c_str()); + std::string converted_label = ConvertAcceleratorsFromWindowsStyle(label); + GtkWidget* menu_item = + gtk_menu_item_new_with_mnemonic(converted_label.c_str()); AddMenuItemWithId(menu_item, command_id); } @@ -55,7 +57,9 @@ void MenuGtk::AppendMenuItemWithIcon(int command_id, void MenuGtk::AppendCheckMenuItemWithLabel(int command_id, const std::string& label) { - GtkWidget* menu_item = gtk_check_menu_item_new_with_mnemonic(label.c_str()); + std::string converted_label = ConvertAcceleratorsFromWindowsStyle(label); + GtkWidget* menu_item = + gtk_check_menu_item_new_with_mnemonic(converted_label.c_str()); AddMenuItemWithId(menu_item, command_id); } @@ -192,7 +196,9 @@ void MenuGtk::BuildMenuIn(GtkWidget* menu, GtkWidget* MenuGtk::BuildMenuItemWithImage(const std::string& label, const SkBitmap& icon) { - GtkWidget* menu_item = gtk_image_menu_item_new_with_mnemonic(label.c_str()); + std::string converted_label = ConvertAcceleratorsFromWindowsStyle(label); + GtkWidget* menu_item = + gtk_image_menu_item_new_with_mnemonic(converted_label.c_str()); GdkPixbuf* pixbuf = gfx::GdkPixbufFromSkBitmap(&icon); gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menu_item), |