factor = 1.0;
switch (view->pending_scroll) {
case SCROLL_TO_KEEP_POSITION:
+ case SCROLL_TO_FIND_LOCATION:
factor = (adjustment->value) / adjustment->upper;
break;
case SCROLL_TO_PAGE_POSITION:
*/
switch (view->pending_scroll) {
case SCROLL_TO_KEEP_POSITION:
+ case SCROLL_TO_FIND_LOCATION:
new_value = CLAMP (adjustment->upper * factor + 0.5, 0, adjustment->upper - adjustment->page_size);
gtk_adjustment_set_value (adjustment, (int)new_value);
break;
gint current_page;
gint best_current_page = -1;
- if (view->pending_scroll != SCROLL_TO_KEEP_POSITION)
- return;
-
/* Presentation trumps all other modes */
if (view->presentation) {
view->start_page = view->current_page;
best_current_page = MAX (best_current_page, view->start_page);
current_page = ev_page_cache_get_current_page (view->page_cache);
- if (current_page != best_current_page) {
+ if ((current_page != best_current_page) && (view->pending_scroll == SCROLL_TO_KEEP_POSITION)) {
view->current_page = best_current_page;
ev_page_cache_set_current_page (view->page_cache, best_current_page);
}
view->jump_to_find_result = FALSE;
- if (view->presentation) {
+ if (view->presentation || view->sizing_mode == EV_SIZING_BEST_FIT) {
switch (scroll) {
case EV_SCROLL_PAGE_BACKWARD:
case EV_SCROLL_STEP_BACKWARD:
GtkAdjustment *adjustment;
int value;
- view->pending_scroll = SCROLL_TO_KEEP_POSITION;
+ view->pending_scroll = SCROLL_TO_FIND_LOCATION;
adjustment = view->vadjustment;
widget->allocation.width + MARGIN);
gtk_adjustment_set_value (view->hadjustment, value);
}
+
+ gtk_widget_queue_resize (GTK_WIDGET (view));
}
/*** Geometry computations ***/
view_set_adjustment_values (view, GTK_ORIENTATION_HORIZONTAL);
view_set_adjustment_values (view, GTK_ORIENTATION_VERTICAL);
- view->pending_scroll = SCROLL_TO_KEEP_POSITION;
- view->pending_resize = FALSE;
-
if (view->document)
view_update_range_and_current_page (view);
+ view->pending_scroll = SCROLL_TO_KEEP_POSITION;
+ view->pending_resize = FALSE;
+
GTK_WIDGET_CLASS (ev_view_parent_class)->size_allocate (widget, allocation);
}
ev_view_set_cursor (view, EV_VIEW_CURSOR_NORMAL);
}
- if (view->document) {
+ if (view->document && view->pressed_button == 1) {
link = ev_view_get_link_at_location (view, event->x, event->y);
} else {
link = NULL;
double real_scale;
int target_width;
+ /* Don't annoy users with loading messages during presentations.
+ * FIXME: Temporary "workaround" for
+ * http://bugzilla.gnome.org/show_bug.cgi?id=320352 */
+ if (view->presentation)
+ return;
+
const char *loading_text = _("Loading...");
layout = gtk_widget_create_pango_layout (GTK_WIDGET (view), loading_text);