Uploaded image for project: 'Qt Design Studio'
  1. Qt Design Studio
  2. QDS-15536

Upgrade handling of Figma Auto-layout

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • QDS 4.7.2
    • None

    Description

      There are currently a number of issues with Figma Auto-layouts and representing them correctly visually in QML (via exporter (Bridge) and importer (QDS)). These will be listed below:

      1. Bridge
        1. For layouts with fixed spacing we create spacers so that rescaling the layout behaves in the same way as in Figma. There, the spacing is fixed and any extra space is added at the edges. However, these spacers contribute to the positioning of the other items inside of a layout (i.e. say there's a layout with 3 elements, spacing = 50, we add a spacer in front that adds this unnecessary 50 that we cannot get rid of). I'm not sure how to fix it, if there's no one with good ideas that would mean that we need to change something directly in layouts in the Qt Framework.
        2. In case of auto spacing the elements are not evenly spaced but the spaces between stretch when resized. This poses a problem as we cannot propagate the binding property to QDS, as in. `spacing = sum(parent.height - children.reduce(sumHeight)) / (children.size - 1)`. We could make it so that it is done by QDS or done in Bridge and allow it in QDS somehow.
        3. When there are more items than the size of the layout allows then it is easy to see that some anchors should be lifted. I.e. if items in a layout should be right-top anchored then the bottom and left anchors are unnecessary. Now they are added and somehow the left anchor takes precedence and items are no longer laid out right to left but left to right. This would also require removal of either with or height for the layout.
        4. If items in a layout are centered, so should be their anchors. We don't do that and even if we did QDS seems to be adding offsets that are wrong (and parent dependent). This would need to be clarified.
        5. Somehow in Figma there is some negative gap value beyond which no visual change happen. This heuristic would have to be determined and accounted in generation.
        6. The effects (besides DesignEffects) are and will be broken for now. We cannot properly calculate the positions in autolayout considering that every effect might have different sizes (overlapping other elements) and it will be very hard to recalculate the correct positioning of all of them.
        7. If any of the above is not supported - warnings during export should be logged.
        8. This issue is best visible with some long rectangle. When it gets rotated (say by 90 degrees) the generated implicit sizes are breaking the visual correctness with Figma. AFAIK there is no way to fix it easily and we have found no other way for now besides wrapping such an element with a non-clipping Item.
      2. QDS
        1. The corresponding Bridge point will require QDS changes.
        2. The corresponding Bridge point will require QDS changes.
        3. No changes.
        4. The corresponding Bridge point will require QDS changes.
        5. No changes.
        6. No changes.
        7. No changes.
        8. Not sure yet.

      All of these issues are visualized in the attached design.

      Attachments

        Issue Links

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

          Activity

            People

              pnd Przemyslaw Lewandowski
              pnd Przemyslaw Lewandowski
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes