X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;ds=inline;f=lib%2Fev-tooltip.c;h=f66f22f53f4ad831dc490be294905283d6b74c7a;hb=9504640af09f77dffce00b13a0623de31d2d0fc3;hp=5e32c5807a29f72b2c123ab305d5f371d6216dac;hpb=ef5061948d20d3fcdefb285c07014954f47dce6d;p=evince.git diff --git a/lib/ev-tooltip.c b/lib/ev-tooltip.c index 5e32c580..f66f22f5 100644 --- a/lib/ev-tooltip.c +++ b/lib/ev-tooltip.c @@ -3,7 +3,7 @@ * Copyright (C) 2004 Red Hat, Inc. * * Author: - * Jonathan Blandford + * Marco Pesenti Gritti * * Evince is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by @@ -29,8 +29,9 @@ #include #define DEFAULT_DELAY 500 -#define STICKY_DELAY 0 +#define STICKY_DELAY 500 #define STICKY_REVERT_DELAY 1000 +#define SPACE_FROM_CURSOR 10 struct _EvTooltipPrivate { GtkWidget *label; @@ -87,6 +88,8 @@ ev_tooltip_init (EvTooltip *tooltip) tooltip->priv = EV_TOOLTIP_GET_PRIVATE (tooltip); + gtk_widget_set_app_paintable (GTK_WIDGET (tooltip), TRUE); + gtk_window_set_resizable (GTK_WINDOW (tooltip), FALSE); gtk_widget_set_name (window, "gtk-tooltips"); label = gtk_label_new (NULL); @@ -126,13 +129,15 @@ ev_tooltip_set_text (EvTooltip *tooltip, const char *text) void ev_tooltip_set_position (EvTooltip *tooltip, int x, int y) { - int root_x = 0, root_y = 0; + int root_x, root_y; if (tooltip->parent != NULL) { gdk_window_get_origin (tooltip->parent->window, &root_x, &root_y); } - gtk_window_move (GTK_WINDOW (tooltip), x + root_x, y + root_y); + gtk_window_move (GTK_WINDOW (tooltip), + x + root_x + SPACE_FROM_CURSOR, + y + root_y + SPACE_FROM_CURSOR); } static gboolean