Pivot
  1. Pivot
  2. PIVOT-75

SplitPane's splitLocation(int) property should be splitRatio(float)

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.1, 1.2
    • Fix Version/s: 1.3
    • Component/s: wtk
    • Labels:
      None

      Description

      For the occasion when SplitPanes are embedded inside each other, it would be nice if I could set the inner SplitPane's to relative-resize-mode i.e. when it's size is reduced or expanded, it should adjust the splitter location to maintain the relative sizes of the top/bottom components.

      To solve this, note that currently, the splitLocation property of SplitPane specifies the absolute pixel value of the splitter within the split pane. This would be much more useful to applications (and much less error-prone) if it were specified as a ratio of one side of the split to the other (from 0.0f to 1.0f). This would have the following benefits:

      1) The caller can initialize the splitter location very easily, whereas previously, you had to presuppose how the split pane would be laid out to give a meaningul splitLocation property.

      2) When the split pane is resized, granting proper allocations to each side of the splitter becomes very easy, since the ratio stays the same.

      1. PIVOT-75-Fix.patch
        12 kB
        Niclas Hedhman
      2. PIVOT-75-Fix2.patch
        16 kB
        Niclas Hedhman
      3. split_ratio.patch
        3 kB
        Greg Brown

        Activity

        Noel Grandin created issue -
        Todd Volkert made changes -
        Field Original Value New Value
        Assignee Todd Volkert [ tvolkert ]
        Greg Brown made changes -
        Fix Version/s 1.3 [ 12313779 ]
        Priority Major [ 3 ] Minor [ 4 ]
        Greg Brown made changes -
        Fix Version/s 1.4 [ 12314033 ]
        Fix Version/s 1.3 [ 12313779 ]
        Greg Brown made changes -
        Assignee Todd Volkert [ tvolkert ] Niclas Hedhman [ niclas ]
        Fix Version/s 1.3 [ 12313779 ]
        Fix Version/s 1.4 [ 12314033 ]
        Greg Brown made changes -
        Priority Minor [ 4 ] Major [ 3 ]
        Niclas Hedhman made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Niclas Hedhman made changes -
        Attachment PIVOT-75-Fix.patch [ 12415719 ]
        Niclas Hedhman made changes -
        Attachment PIVOT-75-Fix2.patch [ 12416020 ]
        Niclas Hedhman made changes -
        Status In Progress [ 3 ] Open [ 1 ]
        Greg Brown made changes -
        Attachment split_ratio.diff [ 12416358 ]
        Greg Brown made changes -
        Attachment split_ratio.diff [ 12416358 ]
        Greg Brown made changes -
        Attachment split_ratio.patch [ 12416359 ]
        Greg Brown made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Todd Volkert made changes -
        Link This issue depends on PIVOT-236 [ PIVOT-236 ]
        Todd Volkert made changes -
        Summary SplitPane should have relative resize style SplitPane's splitLocation(int) property should be splitRatio(float)
        Affects Version/s 1.2 [ 12313781 ]
        Description For the occasion when SplitPanes are embedded inside each other, it would be nice if I could set the inner SplitPane's to relative-resize-mode i.e. when it's size is reduced or expanded, it should adjust the splitter location to maintain the relative sizes of the top/bottom components. For the occasion when SplitPanes are embedded inside each other, it would be nice if I could set the inner SplitPane's to relative-resize-mode i.e. when it's size is reduced or expanded, it should adjust the splitter location to maintain the relative sizes of the top/bottom components.

        To solve this, note that currently, the splitLocation property of SplitPane specifies the absolute pixel value of the splitter within the split pane. This would be much more useful to applications (and much less error-prone) if it were specified as a ratio of one side of the split to the other (from 0.0f to 1.0f). This would have the following benefits:

        1) The caller can initialize the splitter location very easily, whereas previously, you had to presuppose how the split pane would be laid out to give a meaningul splitLocation property.

        2) When the split pane is resized, granting proper allocations to each side of the splitter becomes very easy, since the ratio stays the same.
        Todd Volkert made changes -
        Link This issue depends on PIVOT-236 [ PIVOT-236 ]

          People

          • Assignee:
            Niclas Hedhman
            Reporter:
            Noel Grandin
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development