diff options
author | Iain Merrick <husky@google.com> | 2010-11-01 12:19:54 +0000 |
---|---|---|
committer | Iain Merrick <husky@google.com> | 2010-11-03 10:21:10 +0000 |
commit | 731df977c0511bca2206b5f333555b1205ff1f43 (patch) | |
tree | 0e750b949b3f00a1ac11fda25d3c2de512f2b465 /chrome/browser/gtk/hover_controller_gtk.cc | |
parent | 5add15e10e7bb80512f2c597ca57221314abe577 (diff) | |
download | external_chromium-731df977c0511bca2206b5f333555b1205ff1f43.zip external_chromium-731df977c0511bca2206b5f333555b1205ff1f43.tar.gz external_chromium-731df977c0511bca2206b5f333555b1205ff1f43.tar.bz2 |
Merge Chromium at r63472 : Initial merge by git.
Change-Id: Ifb9ee821af006a5f2211e81471be93ae440a1f5a
Diffstat (limited to 'chrome/browser/gtk/hover_controller_gtk.cc')
-rw-r--r-- | chrome/browser/gtk/hover_controller_gtk.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/chrome/browser/gtk/hover_controller_gtk.cc b/chrome/browser/gtk/hover_controller_gtk.cc index 3adf686..f33554a 100644 --- a/chrome/browser/gtk/hover_controller_gtk.cc +++ b/chrome/browser/gtk/hover_controller_gtk.cc @@ -22,6 +22,8 @@ HoverControllerGtk::HoverControllerGtk(GtkWidget* button) G_CALLBACK(OnLeaveThunk), this); signals_.Connect(button_, "destroy", G_CALLBACK(OnDestroyThunk), this); + signals_.Connect(button_, "hierarchy-changed", + G_CALLBACK(OnHierarchyChangedThunk), this); #ifndef NDEBUG if (g_object_get_data(G_OBJECT(button_), kHoverControllerGtkKey)) @@ -108,6 +110,17 @@ gboolean HoverControllerGtk::OnLeave(GtkWidget* widget, return FALSE; } +void HoverControllerGtk::OnHierarchyChanged(GtkWidget* widget, + GtkWidget* previous_toplevel) { + // GTK+ does not emit leave-notify-event signals when a widget + // becomes unanchored, so manually unset the hover states. + if (!GTK_WIDGET_TOPLEVEL(gtk_widget_get_toplevel(widget))) { + gtk_widget_set_state(button_, GTK_STATE_NORMAL); + hover_animation_.Reset(); + gtk_chrome_button_set_hover_state(GTK_CHROME_BUTTON(button_), 0.0); + } +} + void HoverControllerGtk::OnDestroy(GtkWidget* widget) { Destroy(); } |