Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorNickolay V. Shmyrev <nshmyrev@src.gnome.org>2006-02-24 18:52:02 (GMT)
committer Nickolay V. Shmyrev <nshmyrev@src.gnome.org>2006-02-24 18:52:02 (GMT)
commit43f12175ba221f7c241f0c9cde323c23b8db53e8 (patch)
treec2778a3b6509c3a0273ece64bc3682473571578c /shell
parent835ec7d0d07f4074aebb3e209a354d377b197569 (diff)
Dont't jump to find result if window was scrolled during search. Fix for
* shell/ev-view-private.h: * shell/ev-view.c: (ev_view_scroll), (ev_view_scroll_event), (ev_view_init), (find_changed_cb), (ev_view_find_previous), (ev_view_search_changed): * shell/ev-view.h: * shell/ev-window.c: (find_bar_search_changed_cb): Dont't jump to find result if window was scrolled during search. Fix for the bug #313266.
Diffstat (limited to 'shell')
-rw-r--r--shell/ev-view-private.h1
-rw-r--r--shell/ev-view.c17
-rw-r--r--shell/ev-view.h1
-rw-r--r--shell/ev-window.c1
4 files changed, 18 insertions, 2 deletions
diff --git a/shell/ev-view-private.h b/shell/ev-view-private.h
index b5831e4..1d09cb3 100644
--- a/shell/ev-view-private.h
+++ b/shell/ev-view-private.h
@@ -64,6 +64,7 @@ struct _EvView {
char *status;
char *find_status;
int find_result;
+ gboolean jump_to_find_result;
EvPageCache *page_cache;
EvPixbufCache *pixbuf_cache;
diff --git a/shell/ev-view.c b/shell/ev-view.c
index 2e4752b..7e77f2e 100644
--- a/shell/ev-view.c
+++ b/shell/ev-view.c
@@ -569,6 +569,8 @@ ev_view_scroll (EvView *view,
gboolean first_page = FALSE;
gboolean last_page = FALSE;
+ view->jump_to_find_result = FALSE;
+
if (view->presentation) {
switch (scroll) {
case EV_SCROLL_STEP_BACKWARD:
@@ -1540,6 +1542,7 @@ ev_view_scroll_event (GtkWidget *widget, GdkEventScroll *event)
return TRUE;
}
+ view->jump_to_find_result = FALSE;
/* Shift+Wheel scrolls the in the perpendicular direction */
if (state & GDK_SHIFT_MASK) {
if (event->direction == GDK_SCROLL_UP)
@@ -2568,6 +2571,7 @@ ev_view_init (EvView *view)
view->fullscreen = FALSE;
view->sizing_mode = EV_SIZING_FIT_WIDTH;
view->pending_scroll = SCROLL_TO_KEEP_POSITION;
+ view->jump_to_find_result = TRUE;
}
/*** Callbacks ***/
@@ -2581,8 +2585,11 @@ find_changed_cb (EvDocument *document, int page, EvView *view)
percent = ev_document_find_get_progress
(EV_DOCUMENT_FIND (view->document));
n_pages = ev_page_cache_get_n_pages (view->page_cache);
- jump_to_find_page (view, EV_VIEW_FIND_NEXT, 0);
- jump_to_find_result (view);
+
+ if (view->jump_to_find_result == TRUE) {
+ jump_to_find_page (view, EV_VIEW_FIND_NEXT, 0);
+ jump_to_find_result (view);
+ }
update_find_status_message (view, percent * n_pages >= n_pages - 1 );
if (view->current_page == page)
gtk_widget_queue_draw (GTK_WIDGET (view));
@@ -3436,6 +3443,12 @@ ev_view_find_previous (EvView *view)
}
}
+void ev_view_search_changed (EvView *view)
+{
+ /* search string has changed, focus on new search result */
+ view->jump_to_find_result = TRUE;
+}
+
/*** Selections ***/
/* compute_new_selection_rect/text calculates the area currently selected by
diff --git a/shell/ev-view.h b/shell/ev-view.h
index 90f5031..dc00ff3 100644
--- a/shell/ev-view.h
+++ b/shell/ev-view.h
@@ -122,6 +122,7 @@ int ev_view_get_rotation (EvView *view);
gboolean ev_view_can_find_next (EvView *view);
void ev_view_find_next (EvView *view);
void ev_view_find_previous (EvView *view);
+void ev_view_search_changed (EvView *view);
/* Status */
const char *ev_view_get_status (EvView *view);
diff --git a/shell/ev-window.c b/shell/ev-window.c
index 61e7b1f..944a469 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -2621,6 +2621,7 @@ find_bar_search_changed_cb (EggFindBar *find_bar,
#if 0
g_printerr ("search for '%s'\n", search_string ? search_string : "(nil)");
#endif
+ ev_view_search_changed (EV_VIEW(ev_window->priv->view));
if (ev_window->priv->document &&
EV_IS_DOCUMENT_FIND (ev_window->priv->document)) {