Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-87007

Flickable.originY and respective documentation does not take topMargin into account

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.15.0
    • Fix Version/s: None
    • Labels:
      None
    • Platform/s:
      All

      Description

      According Flickable documentation "If you flick back to the origin (the top-left corner), after the rebound animation, contentX will settle to the same value as originX, and contentY to originY"

      But if you have added margin around the content using Flickable.topMargin the top-left corner is actually moved (and similar applies for leftMargin, and for bottomMargin and rightMargin when calculating bottom-right position), and the flicking to top goes past the originY so technically the statement is no longer true. If you use negative Flickable.topMargin (e.g. to show flickable contents faded out behind some fixed header) originY is actually a position where user can never scroll to. If you provide user action to jump back to the top of the view (e.g. scrollbar, or some jump up button) you need to move the contentY to (originY - topMargin) to land in the expected initial position.

      Not sure what are all the ramifications, but on face value to me originY implies the initial position of the top-down view and in retrospect should have been made to take the topMargin into account, but there may be valid reason behind the decision and also may be that a behavior break is not possible at this point. The documentation should at least be updated, now if you set contentY to originY it can even go out of accepted bounds (if you set negative topMargin).

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            srutledg Shawn Rutledge
            Reporter:
            jpetrell Joona Petrell
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes