Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Unified Diff: views/widget/widget_gtk.cc

Issue 197031: Fleshes out the tooltip implementation for views on Gtk. It doesn't... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « views/widget/widget_gtk.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/widget/widget_gtk.cc
===================================================================
--- views/widget/widget_gtk.cc (revision 25502)
+++ views/widget/widget_gtk.cc (working copy)
@@ -287,6 +287,11 @@
tooltip_manager_.reset(new TooltipManagerGtk(this));
+ // Register for tooltips.
+ g_object_set(G_OBJECT(window_contents_), "has-tooltip", TRUE, NULL);
+ g_signal_connect(G_OBJECT(window_contents_), "query_tooltip",
+ G_CALLBACK(CallQueryTooltip), this);
+
if (type_ == TYPE_CHILD) {
if (parent) {
WidgetGtk* parent_widget = GetViewForNative(parent);
@@ -668,7 +673,7 @@
last_mouse_event_was_move_ = false;
if (!has_capture_ && !is_mouse_down_)
root_view_->ProcessOnMouseExited();
- return true;
+ return false;
}
gboolean WidgetGtk::OnKeyPress(GtkWidget* widget, GdkEventKey* event) {
@@ -681,6 +686,13 @@
return root_view_->ProcessKeyEvent(key_event);
}
+gboolean WidgetGtk::OnQueryTooltip(gint x,
+ gint y,
+ gboolean keyboard_mode,
+ GtkTooltip* tooltip) {
+ return tooltip_manager_->ShowTooltip(x, y, keyboard_mode, tooltip);
+}
+
gboolean WidgetGtk::OnGrabBrokeEvent(GtkWidget* widget, GdkEvent* event) {
HandleGrabBroke();
return false; // To let other widgets get the event.
@@ -972,6 +984,16 @@
return widget_gtk->OnKeyRelease(widget, event);
}
+// static
+gboolean WidgetGtk::CallQueryTooltip(GtkWidget* widget,
+ gint x,
+ gint y,
+ gboolean keyboard_mode,
+ GtkTooltip* tooltip,
+ WidgetGtk* host) {
+ return host->OnQueryTooltip(x, y, keyboard_mode, tooltip);
+}
+
gboolean WidgetGtk::CallScroll(GtkWidget* widget, GdkEventScroll* event) {
WidgetGtk* widget_gtk = GetViewForNative(widget);
if (!widget_gtk)
« no previous file with comments | « views/widget/widget_gtk.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698