mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-13 05:50:10 +00:00
also handle keyboard tooltips. (#408325, Matthias Clasen).
2007-02-16 Kristian Rietveld <kris@imendio.com> * tests/testtooltips.c (query_tooltip_text_view_cb): also handle keyboard tooltips. (#408325, Matthias Clasen). svn path=/trunk/; revision=17313
This commit is contained in:
parent
ee6b709ffd
commit
31e8b394cc
@ -1,3 +1,8 @@
|
||||
2007-02-16 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* tests/testtooltips.c (query_tooltip_text_view_cb): also handle
|
||||
keyboard tooltips. (#408325, Matthias Clasen).
|
||||
|
||||
2007-02-16 Xan Lopez <xan@gnome.org>
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_expose_event): Cleanup the logic
|
||||
|
@ -62,14 +62,25 @@ query_tooltip_text_view_cb (GtkWidget *widget,
|
||||
GtkTooltip *tooltip,
|
||||
gpointer data)
|
||||
{
|
||||
gint bx, by, trailing;
|
||||
GtkTextTag *tag = data;
|
||||
GtkTextIter iter;
|
||||
GtkTextView *text_view = GTK_TEXT_VIEW (widget);
|
||||
|
||||
gtk_text_view_window_to_buffer_coords (text_view, GTK_TEXT_WINDOW_TEXT,
|
||||
x, y, &bx, &by);
|
||||
gtk_text_view_get_iter_at_position (text_view, &iter, &trailing, bx, by);
|
||||
if (keyboard_tip)
|
||||
{
|
||||
gint offset;
|
||||
|
||||
g_object_get (text_view->buffer, "cursor-position", &offset, NULL);
|
||||
gtk_text_buffer_get_iter_at_offset (text_view->buffer, &iter, offset);
|
||||
}
|
||||
else
|
||||
{
|
||||
gint bx, by, trailing;
|
||||
|
||||
gtk_text_view_window_to_buffer_coords (text_view, GTK_TEXT_WINDOW_TEXT,
|
||||
x, y, &bx, &by);
|
||||
gtk_text_view_get_iter_at_position (text_view, &iter, &trailing, bx, by);
|
||||
}
|
||||
|
||||
if (gtk_text_iter_has_tag (&iter, tag))
|
||||
gtk_tooltip_set_markup (tooltip, "Tooltip on text tag");
|
||||
|
Loading…
Reference in New Issue
Block a user