← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

Re: [Merge] lp:~verzegnassi-stefano/ubuntu-docviewer-app/uitk13-lok-page into lp:ubuntu-docviewer-app

 

Review: Needs Information

See inline comments!

Diff comments:

> 
> === modified file 'src/app/qml/loView/KeybHelper.js'
> --- src/app/qml/loView/KeybHelper.js	2015-12-14 00:40:55 +0000
> +++ src/app/qml/loView/KeybHelper.js	2016-03-24 15:02:54 +0000
> @@ -14,83 +14,59 @@
>   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
>   */
>   
> +// Here we handle all the key events that are not
> +// recognised by UITK ScrollView
> +
>  function parseEvent(event) {
> -    var pixelDiff = 5;
> -
>      var view = loPage.contentItem.loView
>      var isPresentation = view.document.documentType === LibreOffice.Document.PresentationDocument
>  
>      if (event.key == Qt.Key_PageUp) {
> -        if (isPresentation)
> +        if (isPresentation) {
>              view.currentPart -= 1
> -        else
> -            view.moveView("vertical", -view.height)
> - 
> +            event.accepted = true
> +        }
>          return;
>      }
>   
>      if (event.key == Qt.Key_PageDown) {
> -        if (isPresentation)
> +        if (isPresentation) {
>              view.currentPart += 1
> -        else
> -            view.moveView("vertical", view.height)
> - 
> +            event.accepted = true
> +        }
>          return;
>      }
>   
>      if (event.key == Qt.Key_Home) {
> -        if (event.modifiers & Qt.ControlModifier) {
> -            view.contentX = 0
> -            view.contentY = 0
> +        if (event.modifiers & Qt.ControlModifier)
>              view.currentPart = 0
> -        } else {
> -            view.contentX = 0
> -            view.contentY = 0
> -        }
> +
> +        event.accepted = false
> +        return
>      }
>  
>      if (event.key == Qt.Key_End) {
> -        if (event.modifiers & Qt.ControlModifier) {
> -            view.contentX = view.contentWidth - view.width
> -            view.contentY = view.contentHeight - view.height
> -            console.log(view.currentPart, view.document.partsCount - 1)
> +        if (event.modifiers & Qt.ControlModifier)
>              view.currentPart = view.document.partsCount - 1
> -        } else {
> -            view.contentX = view.contentWidth - view.width
> -            view.contentY = view.contentHeight - view.height
> -        }
> -    }
>  

Haha, are you enjoyed deleting this code? ;)

> -    if (event.key == Qt.Key_Up) {
> -        view.moveView("vertical", -pixelDiff)
> -        return;
> -    }
> - 
> -    if (event.key == Qt.Key_Down) {
> -        view.moveView("vertical", pixelDiff)
> -        return;
> -    }
> - 
> -    if (event.key == Qt.Key_Left) {
> -        view.moveView("horizontal", -pixelDiff)
> -        return;
> -    }
> - 
> -    if (event.key == Qt.Key_Right) {
> -        view.moveView("horizontal", pixelDiff)
> -        return;
> +        event.accepted = false
> +        return
>      }
>  
>      if (event.key == Qt.Key_Plus) {
>          if (event.modifiers & Qt.ControlModifier) {
> -            view.zoomFactor = Math.max(4.0, view.zoomFactor + 0.25)
> +            view.setZoom(Math.min(view.zoomSettings.maximumZoom, view.zoomSettings.zoomFactor + 0.25))
>          }
> +
> +        return
>      }
>  
>      if (event.key == Qt.Key_Minus) {
>          if (event.modifiers & Qt.ControlModifier) {
> -            view.zoomFactor = Math.min(0.5, view.zoomFactor - 0.25)
> +            view.setZoom(Math.max(view.zoomSettings.minimumZoom, view.zoomSettings.zoomFactor - 0.25))
>          }
> +
> +        return
>      }
>  
>  
> 
> === modified file 'src/app/qml/loView/LOViewPage.qml'
> --- src/app/qml/loView/LOViewPage.qml	2016-02-03 21:35:53 +0000
> +++ src/app/qml/loView/LOViewPage.qml	2016-03-24 15:02:54 +0000
> @@ -265,12 +269,21 @@
>          }
>      }
>  
> -    // *** HEADER ***
> -    state: "default"
> -    states: [
> -        LOViewDefaultHeader {
> -            name: "default"
> -            targetPage: loPage
> -        }
> -    ]
> +
> +    /*** Headers ***/
> +
> +    LOViewDefaultHeader {
> +        id: defaultHeader
> +        visible: loPage.loaded
> +        title: DocumentViewer.getFileBaseNameFromPath(file.path);

Why did you switch it off? Just for information.

> +        // FIXME: re-enable
> +        //flickable: isTextDocument ? loPage.contentItem.loView : null
> +        targetPage: loPage
> +    }
> +
> +    PageHeader {
> +        id: loadingHeader
> +        visible: !loPage.loaded
> +        // When we're still loading LibreOffice, show an empty header
> +    }
>  }


-- 
https://code.launchpad.net/~verzegnassi-stefano/ubuntu-docviewer-app/uitk13-lok-page/+merge/290048
Your team Ubuntu Document Viewer Developers is subscribed to branch lp:ubuntu-docviewer-app.


References