Uploaded image for project: 'Pivot'
  1. Pivot
  2. PIVOT-75

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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.1, 1.2
    • 1.3
    • wtk
    • 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.

      Attachments

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

        Activity

          People

            niclas Niclas Hedhman
            grandinj Noel Grandin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: