Commit db919fa6 authored by estade@chromium.org's avatar estade@chromium.org

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
parent d14c7ac0
......@@ -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));
}
......@@ -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),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment