After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 689468 - Smarter page size and layout options
Smarter page size and layout options
Status: RESOLVED OBSOLETE
Product: evince
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
: 494880 494882 (view as bug list)
Depends on:
Blocks: 689038
 
 
Reported: 2012-12-02 01:52 UTC by William Jon McCann
Modified: 2018-05-22 14:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use a more readable best fit (6.95 KB, patch)
2012-12-02 01:54 UTC, William Jon McCann
rejected Details | Review
Make page layout a mode (38.62 KB, patch)
2012-12-02 01:54 UTC, William Jon McCann
none Details | Review
Make best fit the default (2.09 KB, patch)
2012-12-02 23:07 UTC, William Jon McCann
none Details | Review
Make page layout a mode (39.10 KB, patch)
2012-12-03 01:59 UTC, William Jon McCann
none Details | Review
Don't show dual pages by default for landscape (39.13 KB, patch)
2012-12-03 04:44 UTC, William Jon McCann
reviewed Details | Review
Use a more readable best fit (20.96 KB, patch)
2012-12-04 05:46 UTC, William Jon McCann
none Details | Review
Make page layout a mode (39.11 KB, patch)
2012-12-04 05:46 UTC, William Jon McCann
none Details | Review
Make best fit the default (2.09 KB, patch)
2012-12-04 05:47 UTC, William Jon McCann
none Details | Review
Use a more readable best fit (20.27 KB, patch)
2012-12-04 07:44 UTC, William Jon McCann
none Details | Review
Make best fit the default (2.05 KB, patch)
2012-12-04 07:44 UTC, William Jon McCann
none Details | Review
Make page layout a mode (40.20 KB, patch)
2012-12-04 07:45 UTC, William Jon McCann
none Details | Review
Make page layout a mode (40.31 KB, patch)
2012-12-05 02:16 UTC, William Jon McCann
needs-work Details | Review
Add a new default mode that optimizes for readability (31.39 KB, patch)
2012-12-12 11:07 UTC, William Jon McCann
none Details | Review
Make page layout a mode (45.13 KB, patch)
2012-12-12 11:07 UTC, William Jon McCann
none Details | Review
Remove dual from toolbar (1.68 KB, patch)
2012-12-12 11:07 UTC, William Jon McCann
none Details | Review
Add missing enum nickname for automatic sizing mode (843 bytes, patch)
2013-01-08 20:07 UTC, William Jon McCann
none Details | Review
Make page layout a mode (20.84 KB, patch)
2013-01-08 20:07 UTC, William Jon McCann
committed Details | Review
Use page layout mode internally (9.26 KB, patch)
2013-01-08 20:07 UTC, William Jon McCann
none Details | Review

Description William Jon McCann 2012-12-02 01:52:55 UTC
I think we can do a bit better job picking the default document display size in order to make documents easier to read.

There are a couple of cases to consider.

Documents in portrait/letter orientation should fit the window width up to a point window becomes wider than the natural size of the document (ie. 100%). Using a zoom factor > 100% actually makes the document harder to read in most cases. Consider a maximized Evince window on a large display - fit to width would be quite hard to use.

When the window width becomes wide enough to fit two pages at the natural size I think we should try to automatically put them side by side.

Documents in landscape orientation should always fill the window in a way similar to what Best Fit does now. This is because they are typically things like presentations and spreadsheets and things like that. Things you typically don't want to scroll.

Of course, I think the above should only be the defaults and manually zooming should still be possible.

The following patches accomplish these things by:

 * Redefining Best Fit to only zoom up to 100% for portrait and always fit landscape
 * Adding two new page layout types (to supplement the existing two dual modes) for Automatic and Single Page layout.
Comment 1 William Jon McCann 2012-12-02 01:54:32 UTC
Created attachment 230426 [details] [review]
Use a more readable best fit
Comment 2 William Jon McCann 2012-12-02 01:54:35 UTC
Created attachment 230427 [details] [review]
Make page layout a mode

Instead of having a few different mutually exclusive booleans it
makes sense to have it be a mode with the following options:
automatic, single, dual-even, dual-odd.

This allows us to have a way to automatically determine if dual page
mode should be used when the window is large enough.
Comment 3 William Jon McCann 2012-12-02 01:55:48 UTC
*** Bug 494882 has been marked as a duplicate of this bug. ***
Comment 4 William Jon McCann 2012-12-02 01:56:17 UTC
*** Bug 494880 has been marked as a duplicate of this bug. ***
Comment 5 William Jon McCann 2012-12-02 23:07:03 UTC
Created attachment 230498 [details] [review]
Make best fit the default
Comment 6 Christian Persch 2012-12-02 23:31:08 UTC
Review of attachment 230427 [details] [review]:

::: libview/ev-document-model.h
@@ +46,3 @@
+	EV_PAGE_LAYOUT_DUAL_ODD,
+} EvPageLayout;
+

Need to add this type's get_type function to libevview.types .
Comment 7 William Jon McCann 2012-12-03 01:59:22 UTC
Created attachment 230501 [details] [review]
Make page layout a mode

Instead of having a few different mutually exclusive booleans it
makes sense to have it be a mode with the following options:
automatic, single, dual-even, dual-odd.

This allows us to have a way to automatically determine if dual page
mode should be used when the window is large enough.
Comment 8 William Jon McCann 2012-12-03 04:44:06 UTC
Created attachment 230503 [details] [review]
Don't show dual pages by default for landscape
Comment 9 Carlos Garcia Campos 2012-12-03 14:31:18 UTC
Review of attachment 230426 [details] [review]:

Maybe we could rename the best fit mode as page fit, and consider adding a new best fit mode (I'm not sure we want more modes though). Our current best fit mode matches what other document viewers do, and even what eog does when using best fit zoom. Also the patch breaks Fit links, see page 366 of the PDF spec:

"Fit: Display the page designated by page, with its contents magnified just enough to fit the entire page within the window both horizontally and vertically."
Comment 10 Carlos Garcia Campos 2012-12-03 14:36:55 UTC
Review of attachment 230503 [details] [review]:

I like the idea of using a EvPageLayout enum. This patch breaks the API, we should deprecated old methods instead of removing them, I think. Do you know the gnome3-style branch? I think new patches changing the toolbar and menu UI should probably added to that branch, that will hopefully merged into master soon (only blocked by bug #687931). In gnome3-style branch the dual mode with odd pages on the left is not a mode anymore, but an option for the dual mode, as suggested by lapo.
Comment 11 William Jon McCann 2012-12-04 05:46:55 UTC
Created attachment 230623 [details] [review]
Use a more readable best fit
Comment 12 William Jon McCann 2012-12-04 05:46:59 UTC
Created attachment 230624 [details] [review]
Make page layout a mode

Instead of having a few different mutually exclusive booleans it
makes sense to have it be a mode with the following options:
automatic, single, dual-even, dual-odd.

This allows us to have a way to automatically determine if dual page
mode should be used when the window is large enough.
Comment 13 William Jon McCann 2012-12-04 05:47:02 UTC
Created attachment 230625 [details] [review]
Make best fit the default
Comment 14 William Jon McCann 2012-12-04 07:44:51 UTC
Created attachment 230626 [details] [review]
Use a more readable best fit

Updated for gnome3 branch
Comment 15 William Jon McCann 2012-12-04 07:44:57 UTC
Created attachment 230627 [details] [review]
Make best fit the default
Comment 16 William Jon McCann 2012-12-04 07:45:04 UTC
Created attachment 230628 [details] [review]
Make page layout a mode

Instead of having a few different mutually exclusive booleans it
makes sense to have it be a mode with the following options:
automatic, single, dual-even, dual-odd.

This allows us to have a way to automatically determine if dual page
mode should be used when the window is large enough.
Comment 17 William Jon McCann 2012-12-05 02:16:58 UTC
Created attachment 230712 [details] [review]
Make page layout a mode

Instead of having a few different mutually exclusive booleans it
makes sense to have it be a mode with the following options:
automatic, single, dual-even, dual-odd.

This allows us to have a way to automatically determine if dual page
mode should be used when the window is large enough.
Comment 18 Carlos Garcia Campos 2012-12-06 10:55:42 UTC
Review of attachment 230712 [details] [review]:

The patch still breaks the API, old properties should be deprecated instead of removed. I'm also concerned about removing the layout buttons from the toolbar and hide them in the view menu. It makes the options hard to discover, makes the view menu even longer, and you need two clicks to change the layout. I wonder if instead of a new mode, the automatic layout might be an option that changes automatically between dual and non-dual.
Comment 19 Carlos Garcia Campos 2012-12-06 11:15:36 UTC
(In reply to comment #0)
> I think we can do a bit better job picking the default document display size in
> order to make documents easier to read.
> 
> There are a couple of cases to consider.
> 
> Documents in portrait/letter orientation should fit the window width up to a
> point window becomes wider than the natural size of the document (ie. 100%).
> Using a zoom factor > 100% actually makes the document harder to read in most
> cases. Consider a maximized Evince window on a large display - fit to width
> would be quite hard to use.
> 
> When the window width becomes wide enough to fit two pages at the natural size
> I think we should try to automatically put them side by side.
> 
> Documents in landscape orientation should always fill the window in a way
> similar to what Best Fit does now. This is because they are typically things
> like presentations and spreadsheets and things like that. Things you typically
> don't want to scroll.
> 
> Of course, I think the above should only be the defaults and manually zooming
> should still be possible.
> 
> The following patches accomplish these things by:
> 
>  * Redefining Best Fit to only zoom up to 100% for portrait and always fit
> landscape
>  * Adding two new page layout types (to supplement the existing two dual modes)
> for Automatic and Single Page layout.

After trying the new best fit, I wonder if we can achieve the same without redefining best fit and adding a new mode. The new best fit is actually a combination of fit width + 100%. So, why not use current modes to set them by default depending on the window size and document size? The new automatic layout might change the zoom mode also to use the new best fit approach. 

I'm also concerned about the name, I find very difficult to explain what the new best fit is in a few words, and 'best fit' is very confusing, even more considering it's used to be different thing. I would probably avoid to use 'best', for example, for me the best fit is always fit-width and it's what I always use by default for all the documents.
Comment 20 Carlos Garcia Campos 2012-12-06 12:27:36 UTC
Review of attachment 230712 [details] [review]:

Sorry, with rejected here I meant needs-work (I guess I'm too used to webkit review process already), mainly because of the api break.
Comment 21 Christian Persch 2012-12-08 19:27:27 UTC
I also think we shouldn't break API/ABI this cycle, esp. for something as trivial as this. It should be very easy to keep the old functions and make them do the right thing wrt. the new mode. If we were to break API, we should do it for bigger things, and/or when we've accumulated more reasons. (E.g. I'd want to rework the backend module stuff, but don't have time this cycle, and I don't think we should break API, and next cycle again, etc.)...
Comment 22 William Jon McCann 2012-12-12 11:07:23 UTC
Created attachment 231341 [details] [review]
Add a new default mode that optimizes for readability

This "Automatic" zoom mode will use fit width when
the window is smaller than 100% of the actual page size
and then use the actual page size up to the point the
window is large enough to hold two entire pages side
by side.
Comment 23 William Jon McCann 2012-12-12 11:07:32 UTC
Created attachment 231342 [details] [review]
Make page layout a mode

Instead of having a few different mutually exclusive booleans it
makes sense to have it be a mode with the following options:
automatic, single, dual.

With a separate option to determine whether a separate cover page
should be shown in dual page views.

This allows us to have a way to automatically determine if dual page
mode should be used when the window is large enough.
Comment 24 William Jon McCann 2012-12-12 11:07:38 UTC
Created attachment 231343 [details] [review]
Remove dual from toolbar
Comment 25 Carlos Garcia Campos 2012-12-29 13:03:54 UTC
(In reply to comment #22)
> Created an attachment (id=231341) [details] [review]
> Add a new default mode that optimizes for readability
> 
> This "Automatic" zoom mode will use fit width when
> the window is smaller than 100% of the actual page size
> and then use the actual page size up to the point the
> window is large enough to hold two entire pages side
> by side.

I've split this patch and pushed to gnome3-style branch the renames (best fit -> fit page and fit page width -> fit width) as separate patches without breaking the api
Comment 26 Carlos Garcia Campos 2012-12-29 15:02:21 UTC
Review of attachment 231341 [details] [review]:

::: libview/ev-view.c
@@ +1556,3 @@
+					ev_link_dest_get_bottom (dest) - top,
+					allocation.width,
+					allocation.height);

We can't change this, it breaks fitr links.

@@ +1647,3 @@
+					doc_width, doc_height,
+					allocation.width,
+					allocation.height);

Same here for fit links.

@@ +5477,3 @@
+	double scale;
+
+			 int        target_width,

I think it would be easier to understand what automatic means calling the other sizing methods, for example here:

fit_width_scale = zoom_for_size_fit_width (doc_width, doc_height, target_width, target_height);

instead of (double)target_width / doc_width;

@@ +5609,3 @@
+	} else if (view->sizing_mode == EV_SIZING_AUTOMATIC)
+		scale = zoom_for_size_automatic (gtk_widget_get_screen (GTK_WIDGET (view)),
+						 doc_width, doc_height, width, height);

You should consider the vertical scrollbar here

@@ +5642,3 @@
+	} else if (view->sizing_mode == EV_SIZING_AUTOMATIC)
+		scale = zoom_for_size_automatic (gtk_widget_get_screen (GTK_WIDGET (view)),
+						 doc_width, doc_height, width, height);

You should consider the vertical scrollbar here too

::: previewer/ev-previewer-window.c
@@ +136,3 @@
 static void
+ev_previewer_window_zoom_automatic (GtkToggleAction   *action,
+				    EvPreviewerWindow *window)

Why do you remove the fit page option from the evince previewer?

::: shell/evince-toolbar.xml
@@ +17,3 @@
     <toolitem name="ViewZoomOut"/>
+    <toolitem name="ViewSizingAutomatic"/>
+    <toolitem name="ViewSizingFitWidth"/>

This is the old evince toolbar that has been removed in gnome3-style branch, si this doesn't have any effect. I forgot to remove this file.
Comment 27 Carlos Garcia Campos 2012-12-29 15:19:58 UTC
(In reply to comment #25)
> (In reply to comment #22)
> > Created an attachment (id=231341) [details] [review] [details] [review]
> > Add a new default mode that optimizes for readability
> > 
> > This "Automatic" zoom mode will use fit width when
> > the window is smaller than 100% of the actual page size
> > and then use the actual page size up to the point the
> > window is large enough to hold two entire pages side
> > by side.
> 
> I've split this patch and pushed to gnome3-style branch the renames (best fit
> -> fit page and fit page width -> fit width) as separate patches without
> breaking the api

I've split the patch more and pushed the libview part to add the automatic sizing mode, but without changing the defaults, so that you can start using it from documents/sushi
Comment 28 William Jon McCann 2013-01-08 18:05:56 UTC
commit 0cad8758e9d96a1cf3b8a07776e64b6ae602b4e7

claims to enable an automatic two page mode but that code wasn't committed.

How would you prefer we add this capability if not the above?
Comment 29 William Jon McCann 2013-01-08 20:07:15 UTC
Created attachment 233007 [details] [review]
Add missing enum nickname for automatic sizing mode
Comment 30 William Jon McCann 2013-01-08 20:07:42 UTC
Created attachment 233008 [details] [review]
Make page layout a mode

This adds the mode without breaking API or changing the UI
Comment 31 William Jon McCann 2013-01-08 20:07:47 UTC
Created attachment 233009 [details] [review]
Use page layout mode internally
Comment 32 Carlos Garcia Campos 2013-01-10 11:27:19 UTC
(In reply to comment #29)
> Created an attachment (id=233007) [details] [review]
> Add missing enum nickname for automatic sizing mode

It's not that is missing, settings are only used by the shell and automatic sizing mode hasn't been implemented in the shell yet, only in the library.
Comment 33 Carlos Garcia Campos 2013-01-10 17:37:32 UTC
Review of attachment 233008 [details] [review]:

Pushed with some minor changes and removing the settings changes, that belong to the shell, not libview. Thanks!
Comment 34 GNOME Infrastructure Team 2018-05-22 14:54:27 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/evince/issues/319.