Merge lp://staging/~mrqtros/ubuntu-docviewer-app/ubuntu-docviewer-app-zoom-final into lp://staging/ubuntu-docviewer-app

Proposed by Roman Shchekin
Status: Merged
Approved by: Stefano Verzegnassi
Approved revision: 200
Merged at revision: 204
Proposed branch: lp://staging/~mrqtros/ubuntu-docviewer-app/ubuntu-docviewer-app-zoom-final
Merge into: lp://staging/ubuntu-docviewer-app
Diff against target: 248 lines (+126/-54)
3 files modified
po/com.ubuntu.docviewer.pot (+6/-6)
src/app/qml/common/ScalingPinchArea.qml (+55/-0)
src/app/qml/loView/LOViewPage.qml (+65/-48)
To merge this branch: bzr merge lp://staging/~mrqtros/ubuntu-docviewer-app/ubuntu-docviewer-app-zoom-final
Reviewer Review Type Date Requested Status
Alan Pope 🍺🐧🐱 πŸ¦„ (community) Approve
Stefano Verzegnassi Approve
Jenkins Bot continuous-integration Approve
Review via email: mp+278248@code.staging.launchpad.net

Commit message

Zoom in LO.

Description of the change

Zoom in LO.

To post a comment you must log in.
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
200. By Roman Shchekin

Resolved conflict.

Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Stefano Verzegnassi (verzegnassi-stefano) wrote :

I left 4 diff comments.
They are just a few small notes, your changes look good to me.

Tested on desktop, with both Ubuntu.Layouts modes. I didn't see any regression (cannot test touch events on my PC though).

Tested on the BQ, and works greatly as expected!

Nice work, Roman!

review: Approve
Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

This is looking great.

One thing I noticed though is the zoom dropdown is always fixed on "Automatic (Fit width)" even if you choose another zoom level, or zoom in or out with the buttons. This means if you change the zoom level, you can never re-choose "Fit Width) because it thinks it's already ticked.

review: Needs Fixing
Revision history for this message
Stefano Verzegnassi (verzegnassi-stefano) wrote :

> One thing I noticed though is the zoom dropdown is always fixed on "Automatic
> (Fit width)" even if you choose another zoom level, or zoom in or out with the
> buttons. This means if you change the zoom level, you can never re-choose "Fit
> Width) because it thinks it's already ticked.

Honestly, I've missed that. Thanks!

Just had a look at it, it's not a bug introduced by this MP.

I've checked if the Viewer properly set the zoom mode to Manual when a "custom" (i.e. user-specified) value is set, and it does.

It's rather a bug in the ZoomSelector, from line 126:

selectedIndex: {
    if (loPageContentLoader.item.loView.zoomMode == LibreOffice.View.FitToWidth)
        return 0

    for (var i=0; i<textField.values.length; i++) {
        if (values[i] == loView.zoomFactor) {
            return i
        }
    }

    return -1
}

It returns:
    ReferenceError: loView is not defined

The 'for' loop in the code does not return any index, since the comparison between values[i] and loView.zoomFactor is never executed.
For that reason, the first entry in the ZoomSelector ("Automatic (Fit width)") is always selected.

I didn't take care of the current code of the ZoomSelector, since it was already planned to be replaced with some properly designed code.

This bug is already fixed in the UITK 1.3 branch, since it introduces the new ZoomSelector.

Revision history for this message
Stefano Verzegnassi (verzegnassi-stefano) wrote :

Anyway, and that's for sure, the work on zooming is not completed by this MP.

We still have three relevant things to do:

1) Add the double-tap-to-(un)zoom gesture.

2) Properly define the zoom behaviour (minimum zoom, maximum zoom, default value) for the following three form factors:
        - Touch device with screen.width < units.gu(80) - a.k.a. phones
        - Touch device with screen.width > units.gu(80) - a.k.a. tablet
        - Desktop
   We should also take care that the three types of documents we support through LibreOffice (Text, Spreadsheet and Presentation) have some different requirement.
   I started to have a look at this, but it needs to be planned accurately.

   In particular on phones we should limit the minimum zoom to the value set by the "Fit to width" zoom (e.g. Text document).

3) Introduce two new zoom modes: "Fit to Height" and "Automatic".
   "Automatic" mode should be a mix of "Fit to Height" and "Fit to Width". We need it in order to ensure that slides of presentation documents will be always fully visible, no matter which is the size/ratio of the application window.

Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

Great! Looks good so far!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches