From 02291c7a30eed2a32470219909c8cb96735f8f27 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Wed, 07 Sep 2005 14:55:34 +0000 Subject: Use mozilla style vs gtk style, way better for links. 2005-09-07 Marco Pesenti Gritti * lib/ev-tooltip.c: Use mozilla style vs gtk style, way better for links. * shell/ev-view.c: (ev_view_motion_notify_event), (ev_view_destroy), (ev_view_init): Deactive tooltip when the link hovered is changed. --- diff --git a/ChangeLog b/ChangeLog index d176527..80be1ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2005-09-07 Marco Pesenti Gritti + * lib/ev-tooltip.c: + + Use mozilla style vs gtk style, way better for links. + + * shell/ev-view.c: (ev_view_motion_notify_event), + (ev_view_destroy), (ev_view_init): + + Deactive tooltip when the link hovered is changed. + +2005-09-07 Marco Pesenti Gritti + * backend/ev-document.h: * backend/ev-link.c: (ev_link_type_get_type), (ev_link_get_top), (ev_link_get_left), (ev_link_get_zoom), (ev_link_get_property), diff --git a/lib/ev-tooltip.c b/lib/ev-tooltip.c index 4aeb365..ce8158c 100644 --- a/lib/ev-tooltip.c +++ b/lib/ev-tooltip.c @@ -29,7 +29,7 @@ #include #define DEFAULT_DELAY 500 -#define STICKY_DELAY 0 +#define STICKY_DELAY 500 #define STICKY_REVERT_DELAY 1000 struct _EvTooltipPrivate { diff --git a/shell/ev-view.c b/shell/ev-view.c index 052529e..fa0f087 100644 --- a/shell/ev-view.c +++ b/shell/ev-view.c @@ -150,6 +150,7 @@ struct _EvView { int pressed_button; EvViewCursor cursor; GtkWidget *link_tooltip; + EvLink *hovered_link; EvPageCache *page_cache; EvPixbufCache *pixbuf_cache; @@ -1588,16 +1589,18 @@ ev_view_motion_notify_event (GtkWidget *widget, link = get_link_at_location (view, event->x + view->scroll_x, event->y + view->scroll_y); - if (!link && view->link_tooltip) { + if (view->link_tooltip == NULL) { + view->link_tooltip = ev_tooltip_new (GTK_WIDGET (view)); + } + + if (view->hovered_link != link) { + view->hovered_link = link; ev_tooltip_deactivate (EV_TOOLTIP (view->link_tooltip)); } if (link) { char *msg = tip_from_link (view, link); - if (view->link_tooltip == NULL) { - view->link_tooltip = ev_tooltip_new (GTK_WIDGET (view)); - } ev_tooltip_set_position (EV_TOOLTIP (view->link_tooltip), event->x, event->y); ev_tooltip_set_text (EV_TOOLTIP (view->link_tooltip), msg); ev_tooltip_activate (EV_TOOLTIP (view->link_tooltip)); @@ -1946,13 +1949,14 @@ ev_view_destroy (GtkObject *object) g_object_unref (view->document); view->document = NULL; } + if (view->pixbuf_cache) { g_object_unref (view->pixbuf_cache); view->pixbuf_cache = NULL; } + if (view->link_tooltip) { gtk_widget_destroy (view->link_tooltip); - view->link_tooltip = NULL; } ev_view_set_scroll_adjustments (view, NULL, NULL); @@ -2191,7 +2195,6 @@ ev_view_init (EvView *view) view->cursor = EV_VIEW_CURSOR_NORMAL; view->drag_info.in_drag = FALSE; view->selection_info.in_selection = FALSE; - view->selection_mode = EV_VIEW_SELECTION_TEXT; view->continuous = TRUE; view->dual_page = FALSE; -- cgit v0.9.1