← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

Re: [Merge] lp:~pkunal-parmar/ubuntu-calendar-app/MakeEditorVisible into lp:ubuntu-calendar-app

 

Review: Needs Fixing

try to use "Page.flicabke: null" istead of doing this changes.

Diff comments:

> === modified file 'NewEvent.qml'
> --- NewEvent.qml	2015-03-12 14:44:42 +0000
> +++ NewEvent.qml	2015-03-22 04:35:07 +0000
> @@ -305,6 +305,7 @@
>  
>      Flickable{
>          id: flickable
> +        clip: true
>  
>          property var activeItem: null
>  
> @@ -317,14 +318,14 @@
>              var position = flickable.contentItem.mapFromItem(item, 0, 0);
>  
>              // check if the item is already visible
> -            var bottomY = flickable.contentY + flickable.height
> -            var itemBottom = position.y + item.height
> +            var bottomY =  flickable.contentY + flickable.height
> +            var itemBottom = header.height + position.y + item.height
>              if (position.y >= flickable.contentY && itemBottom <= bottomY) {
>                  return;
>              }
>  
>              // if it is not, try to scroll and make it visible
> -            var targetY = position.y + item.height - flickable.height
> +            var targetY = header.height + position.y + item.height - flickable.height

if you change  the Page.flickable to null, this should not be necessary.

>              if (targetY >= 0 && position.y) {
>                  flickable.contentY = targetY;
>              } else if (position.y < flickable.contentY) {
> @@ -334,7 +335,9 @@
>              flickable.returnToBounds()
>          }
>  
> -        anchors.fill: parent
> +        y: header.height

You should not change the item Y. If you want to the header to be fixable you can set the page property "flickable" to null.

> +        width: parent.width;
> +        height: parent.height;
>          contentWidth: width
>          contentHeight: column.height + units.gu(10)
>  
> @@ -405,6 +408,11 @@
>                      }
>  
>                      placeholderText: i18n.tr("Event Name")
> +                    onFocusChanged: {
> +                        if(titleEdit.focus) {
> +                            flickable.makeMeVisible(titleEdit);
> +                        }
> +                    }
>                  }
>  
>                  TextArea{
> @@ -418,6 +426,11 @@
>                      }
>  
>                      placeholderText: i18n.tr("Description")
> +                    onFocusChanged: {
> +                        if(messageEdit.focus) {
> +                            flickable.makeMeVisible(messageEdit);
> +                        }
> +                    }
>                  }
>  
>                  TextField {
> @@ -431,6 +444,12 @@
>                      }
>  
>                      placeholderText: i18n.tr("Location")
> +
> +                    onFocusChanged: {
> +                        if(locationEdit.focus) {
> +                            flickable.makeMeVisible(locationEdit);
> +                        }
> +                    }
>                  }
>              }
>  
> 


-- 
https://code.launchpad.net/~pkunal-parmar/ubuntu-calendar-app/MakeEditorVisible/+merge/253767
Your team Ubuntu Calendar Developers is subscribed to branch lp:ubuntu-calendar-app.


Follow ups

References