1. 04 Jun, 2013 - 1 commit
    • Jan Arve Saether's avatar
      Fixed some bugs in how effective size hints were calculated · 4051e698
      Jan Arve Saether authored
      
      Do not bound explicit preferred size with implicit sizes. This
      means that if Layout.preferredWidth was *explicitly* set to 50,
      and Layout.maximumWidth had the implicit value 20, the effective
      maximum width would be expanded to 50 in order to not disregard
      the explicitly set preferred width. (covered by the tag
      "expandMaxToExplicitPref" in test_sizeHint)
      
      Note that this doesn't break any autotests, but the row layout
      autotest was slightly changed to be able to add the new test cases.
      
      This should make the behavior match the behavior of
      QGraphicsGridLayout and QGraphicsLinearLayout
      
      Change-Id: Ia23c8ef909827f14349906c003c72bb83689ef9a
      Reviewed-by: default avatarCaroline Chao <caroline.chao@digia.com>
      Reviewed-by: default avatarJens Bache-Wiig <jens.bache-wiig@digia.com>
      4051e698
  2. 16 May, 2013 - 1 commit
  3. 10 May, 2013 - 3 commits
    • Jens Bache-Wiig's avatar
      Revert "Return infinity instead of -1 as a default value for max sizes" · 91fc9b18
      Jens Bache-Wiig authored
      
      This reverts commit a4158c97d84d5c76126307213baf22d12babdbc2
      
      This commit breaks the basiclayouts example so I am reverting it until we have a revised ifx.
      
      Change-Id: I901924d292606ffe1e797232ad2f5ff02d8fc2d6
      Reviewed-by: default avatarJens Bache-Wiig <jens.bache-wiig@digia.com>
      91fc9b18
    • Jan Arve Saether's avatar
      Return infinity instead of -1 as a default value for max sizes · 16558ac7
      Jan Arve Saether authored
      
      This was a bit inconsistent, because in the case of a Rectangle its
      Layout.maximumWidth would return -1 by default (which was supposed to
      be interpreted as infinity) However, since the maximumWidth propagated
      up to the layout, the layout.Layout.maximumWidth would return
      1000000000. Adding two Rectangles to the layout would make
      layout.Layout.maximumWidth return 2000000000, and adding a third item
      with Layout.maximumWidth:1 would make layout.Layout.maximumWidth
      return 2000000001
      
      With this change, since infinity + number = infinity, everything
      that can grow to infinity will just return infinity.
      
      In addition a developer can now more intuitively do comparisons
      like this:
      
      if (value > Layout.minimumWidth && value < Layout.maximumWidth)
      
      instead of
      
      if ((value == -1 || value > Layout.minimumWidth) &&
          (value != -1 && value < Layout.maximumWidth))
      
      Now, as a bonus, it becomes less consistent to set an attached
      (min,max) property to -1 in order to reset it to its implicit value.
      
      This also fixes a documentation issue with regards to the attached
      Layout.{min|max}imum{Width|Height} properties. It only told the story
      correct if the item was not a layout, and updates the docs for the max
      sizes to mention that it returns Number.POSITIVE_INFINITY
      
      Change-Id: Ia638064fd3ed5614d7e496a9b5e4aa8fcb7307f7
      Reviewed-by: default avatarRichard Moe Gustavsen <richard.gustavsen@digia.com>
      16558ac7
    • Jan Arve Saether's avatar
      Layouts implicit sizes was not propagated up properly. · cec77158
      Jan Arve Saether authored
      
      When a layout did not have an implicit size nor any of the
      Layout.preferred* properties set, the size hint calculation would
      fall back to retrieving the width and the height properties of the
      item. It would then store that value in the Layout.preferred*
      property. This was wrong.
      
      This could be a problem when an item was later added to the layout,
      and consequently the implicit size of the layout got updated.
      However, since the layout now had a preferred size set, a parent
      layout would ignore the implicit size it had since it would settle
      with the Layout.preferred* property (that's the rules the
      effectiveSizeHint_helper work with).
      
      The fix is to set the implicit width/height instead of the
      Layout.preferred{width|height} property.
      
      The compare in the test was actually by accident wrong, which can be
      easily verified.
      
      Change-Id: Ib9110dec7988a547441748698348227d1b8a077f
      Reviewed-by: default avatarRichard Moe Gustavsen <richard.gustavsen@digia.com>
      cec77158
  4. 03 May, 2013 - 2 commits
  5. 30 Apr, 2013 - 2 commits
    • Jan Arve Saether's avatar
      Improve how child items are ignored/skipped · 15377099
      Jan Arve Saether authored
      
      The previous code was a bit rough in how it determined if the item
      was supposed to be ignored or not.
      
      For instance, it did not ignore items with
       Layout.maximumWidth: 0
      or
       Layout.preferredWidth: 0
       Layout.fillWidth: false
      
      The following patch will use
      QQuickLayoutItem::effectiveSizeHints_helper. Since that is now shared,
      it should make the behavior more consistent.
      
      The patch also fixes a bug where ignored items (e.g. a hidden item)
      was not re-added to the layout if it became visible again. (QTBUG-30796)
      We use a QSet to keep track of the ignored items, and repopulate the
      layout if any of the items in the QSet changed some properties relevant
      for the layout.
      
      Task-number: QTBUG-30796
      
      Change-Id: Ia4b0584ed61e1b24efaca322551f6bb1a4228ca6
      Reviewed-by: default avatarRichard Moe Gustavsen <richard.gustavsen@digia.com>
      15377099
    • Jan Arve Saether's avatar
      Move logic of effective size hints to effectiveSizeHints_helper · 2b205db8
      Jan Arve Saether authored
      
      This enables us to find the effective size hints without allocating a
      QQuickGridLayoutItem.
      
      Change-Id: I827e3196c0a3979a2f6f5a0d6f3622cd6d121645
      Reviewed-by: default avatarRichard Moe Gustavsen <richard.gustavsen@digia.com>
      2b205db8