summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-21 20:58:12 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-21 20:58:12 +0000
commitcc963f059ac84c9b2427082ca28db2cdeef3080a (patch)
tree1e124e8faf762e53ff86554d733f9ff5098de955
parent195744fbd96ac9d74f07e0dc499f6625d18d193d (diff)
downloadchromium_src-cc963f059ac84c9b2427082ca28db2cdeef3080a.zip
chromium_src-cc963f059ac84c9b2427082ca28db2cdeef3080a.tar.gz
chromium_src-cc963f059ac84c9b2427082ca28db2cdeef3080a.tar.bz2
GTK: Clean up the bookmark bar context menu
- Make items that should be checkboxes into checkboxes - Clean up accelerator spam. Review URL: http://codereview.chromium.org/113721 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16653 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/bookmarks/bookmark_context_menu_gtk.cc3
-rw-r--r--chrome/browser/gtk/menu_gtk.cc10
-rw-r--r--chrome/browser/gtk/menu_gtk.h1
3 files changed, 10 insertions, 4 deletions
diff --git a/chrome/browser/bookmarks/bookmark_context_menu_gtk.cc b/chrome/browser/bookmarks/bookmark_context_menu_gtk.cc
index cf616d9..a60146e 100644
--- a/chrome/browser/bookmarks/bookmark_context_menu_gtk.cc
+++ b/chrome/browser/bookmarks/bookmark_context_menu_gtk.cc
@@ -33,8 +33,7 @@ void BookmarkContextMenu::AppendSeparator() {
}
void BookmarkContextMenu::AppendCheckboxItem(int id) {
- // TODO(erg): Add support for checkbox items to gtk.
- menu_->AppendMenuItemWithLabel(
+ menu_->AppendCheckMenuItemWithLabel(
id,
MenuGtk::ConvertAcceleratorsFromWindowsStyle(
l10n_util::GetStringUTF8(id)));
diff --git a/chrome/browser/gtk/menu_gtk.cc b/chrome/browser/gtk/menu_gtk.cc
index 9786534..e62bff9 100644
--- a/chrome/browser/gtk/menu_gtk.cc
+++ b/chrome/browser/gtk/menu_gtk.cc
@@ -42,7 +42,7 @@ void MenuGtk::ConnectSignalHandlers() {
void MenuGtk::AppendMenuItemWithLabel(int command_id,
const std::string& label) {
- GtkWidget* menu_item = gtk_menu_item_new_with_label(label.c_str());
+ GtkWidget* menu_item = gtk_menu_item_new_with_mnemonic(label.c_str());
AddMenuItemWithId(menu_item, command_id);
}
@@ -53,6 +53,12 @@ void MenuGtk::AppendMenuItemWithIcon(int command_id,
AddMenuItemWithId(menu_item, 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());
+ AddMenuItemWithId(menu_item, command_id);
+}
+
void MenuGtk::AppendSeparator() {
GtkWidget* menu_item = gtk_separator_menu_item_new();
gtk_widget_show(menu_item);
@@ -186,7 +192,7 @@ void MenuGtk::BuildMenuIn(GtkWidget* menu,
GtkWidget* MenuGtk::BuildMenuItemWithImage(const std::string& label,
const SkBitmap& icon) {
- GtkWidget* menu_item = gtk_image_menu_item_new_with_label(label.c_str());
+ GtkWidget* menu_item = gtk_image_menu_item_new_with_mnemonic(label.c_str());
GdkPixbuf* pixbuf = gfx::GdkPixbufFromSkBitmap(&icon);
gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menu_item),
diff --git a/chrome/browser/gtk/menu_gtk.h b/chrome/browser/gtk/menu_gtk.h
index 53a48fe..444ab96 100644
--- a/chrome/browser/gtk/menu_gtk.h
+++ b/chrome/browser/gtk/menu_gtk.h
@@ -59,6 +59,7 @@ class MenuGtk {
void AppendMenuItemWithLabel(int command_id, const std::string& label);
void AppendMenuItemWithIcon(int command_id, const std::string& label,
const SkBitmap& icon);
+ void AppendCheckMenuItemWithLabel(int command_id, const std::string& label);
void AppendSeparator();
// Displays the menu. |timestamp| is the time of activation. The popup is