Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <mpg@redhat.com>2005-09-07 14:55:34 (GMT)
committer Marco Pesenti Gritti <marco@src.gnome.org>2005-09-07 14:55:34 (GMT)
commit02291c7a30eed2a32470219909c8cb96735f8f27 (patch)
tree5ac2a671c93dd59fe8fbadbade096d72c1842cb4 /shell
parent9f8ec2d921de1c31da212c8486ab2bda85d51bf9 (diff)
Use mozilla style vs gtk style, way better for links.
2005-09-07 Marco Pesenti Gritti <mpg@redhat.com> * 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.
Diffstat (limited to 'shell')
-rw-r--r--shell/ev-view.c15
1 files changed, 9 insertions, 6 deletions
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;