diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-08 17:26:01 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-08 17:26:01 +0000 |
commit | b71a24d4c87b70586acb34eae882c8532fe86aba (patch) | |
tree | 961c542d97b9c46172e42135822f652fd9c4e6f7 /chrome/browser/gtk/menu_gtk.cc | |
parent | c8ad40c6b02751c1cc942abe4ecaffbf68bfa611 (diff) | |
download | chromium_src-b71a24d4c87b70586acb34eae882c8532fe86aba.zip chromium_src-b71a24d4c87b70586acb34eae882c8532fe86aba.tar.gz chromium_src-b71a24d4c87b70586acb34eae882c8532fe86aba.tar.bz2 |
GTK bookmark manager: organize menu and aesthetic improvements.
Review URL: http://codereview.chromium.org/118388
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17868 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/menu_gtk.cc')
-rw-r--r-- | chrome/browser/gtk/menu_gtk.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/chrome/browser/gtk/menu_gtk.cc b/chrome/browser/gtk/menu_gtk.cc index 1636f67..f259b39 100644 --- a/chrome/browser/gtk/menu_gtk.cc +++ b/chrome/browser/gtk/menu_gtk.cc @@ -40,6 +40,7 @@ MenuGtk::~MenuGtk() { } void MenuGtk::ConnectSignalHandlers() { + g_signal_connect(menu_.get(), "show", G_CALLBACK(OnMenuShow), this); g_signal_connect(menu_.get(), "hide", G_CALLBACK(OnMenuHidden), this); } @@ -81,8 +82,6 @@ void MenuGtk::Popup(GtkWidget* widget, GdkEvent* event) { } void MenuGtk::Popup(GtkWidget* widget, gint button_type, guint32 timestamp) { - gtk_container_foreach(GTK_CONTAINER(menu_.get()), SetMenuItemInfo, this); - gtk_menu_popup(GTK_MENU(menu_.get()), NULL, NULL, MenuPositionFunc, widget, @@ -90,8 +89,6 @@ void MenuGtk::Popup(GtkWidget* widget, gint button_type, guint32 timestamp) { } void MenuGtk::PopupAsContext(guint32 event_time) { - gtk_container_foreach(GTK_CONTAINER(menu_.get()), SetMenuItemInfo, this); - // TODO(estade): |button| value of 3 (6th argument) is not strictly true, // but does it matter? gtk_menu_popup(GTK_MENU(menu_.get()), NULL, NULL, NULL, NULL, 3, event_time); @@ -284,6 +281,12 @@ void MenuGtk::MenuPositionFunc(GtkMenu* menu, } // static +void MenuGtk::OnMenuShow(GtkWidget* widget, MenuGtk* menu) { + gtk_container_foreach(GTK_CONTAINER(menu->menu_.get()), + SetMenuItemInfo, menu); +} + +// static void MenuGtk::OnMenuHidden(GtkWidget* widget, MenuGtk* menu) { menu->delegate_->StoppedShowing(); } |