inspector: Don't use the ::query-tooltip signal
Use the vfunc, the signal is going away.
This commit is contained in:
@@ -65,13 +65,13 @@ css_error_free (gpointer data)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
query_tooltip_cb (GtkWidget *widget,
|
||||
gint x,
|
||||
gint y,
|
||||
gboolean keyboard_tip,
|
||||
GtkTooltip *tooltip,
|
||||
GtkInspectorCssEditor *ce)
|
||||
gtk_css_editor_query_tooltip (GtkWidget *widget,
|
||||
int x,
|
||||
int y,
|
||||
gboolean keyboard_tip,
|
||||
GtkTooltip *tooltip)
|
||||
{
|
||||
GtkInspectorCssEditor *ce = GTK_INSPECTOR_CSS_EDITOR (widget);
|
||||
GtkTextIter iter;
|
||||
GList *l;
|
||||
|
||||
@@ -86,6 +86,7 @@ query_tooltip_cb (GtkWidget *widget,
|
||||
{
|
||||
gint bx, by, trailing;
|
||||
|
||||
gtk_widget_translate_coordinates (widget, ce->priv->view, x, y, &x, &y);
|
||||
gtk_text_view_window_to_buffer_coords (GTK_TEXT_VIEW (ce->priv->view), GTK_TEXT_WINDOW_TEXT,
|
||||
x, y, &bx, &by);
|
||||
gtk_text_view_get_iter_at_position (GTK_TEXT_VIEW (ce->priv->view), &iter, &trailing, bx, by);
|
||||
@@ -406,6 +407,8 @@ gtk_inspector_css_editor_class_init (GtkInspectorCssEditorClass *klass)
|
||||
object_class->constructed = constructed;
|
||||
object_class->finalize = finalize;
|
||||
|
||||
widget_class->query_tooltip = gtk_css_editor_query_tooltip;
|
||||
|
||||
gtk_widget_class_set_template_from_resource (widget_class, "/org/gtk/libgtk/inspector/css-editor.ui");
|
||||
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorCssEditor, text);
|
||||
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorCssEditor, view);
|
||||
@@ -413,7 +416,6 @@ gtk_inspector_css_editor_class_init (GtkInspectorCssEditorClass *klass)
|
||||
gtk_widget_class_bind_template_callback (widget_class, disable_toggled);
|
||||
gtk_widget_class_bind_template_callback (widget_class, save_clicked);
|
||||
gtk_widget_class_bind_template_callback (widget_class, text_changed);
|
||||
gtk_widget_class_bind_template_callback (widget_class, query_tooltip_cb);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
</object>
|
||||
<template class="GtkInspectorCssEditor" parent="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="has-tooltip">1</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="spacing">6</property>
|
||||
@@ -57,8 +58,6 @@
|
||||
<property name="monospace">1</property>
|
||||
<property name="left-margin">6</property>
|
||||
<property name="right-margin">6</property>
|
||||
<property name="has-tooltip">1</property>
|
||||
<signal name="query-tooltip" handler="query_tooltip_cb"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
||||
Reference in New Issue
Block a user