-
Notifications
You must be signed in to change notification settings - Fork 550
8092379: GridPane should not render extra gaps when entire rows or columns are unmanaged #1990
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
👋 Welcome back jhendrikx! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
Webrevs
|
324eb9c to
69eedce
Compare
|
@hjohn Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information. |
|
/reviewers 2 |
|
@andy-goryachev-oracle |
andy-goryachev-oracle
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
I've updated the standalone Monkey Tester to add a couple of layout scenarios to the GridPane page.
| Interval i = new Interval(startPosition, endPosition); | ||
| multiSizes.put(i, size); | ||
| private void setMaxSize(int position, double size) { | ||
| singleSizes[position] = Math.max(singleSizes[position], size); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know why github shows this as a change.
Unused setMultiSize() has been removed which is ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's confusing the start of the diff I think :)
| private Iterable<Entry<Interval, Double>> multiSizes() { | ||
| if (multiSizes == null) { | ||
| return Collections.EMPTY_LIST; | ||
| return Collections.emptyList(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated change, and probably gets inlined anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, could remove, I just made the change because it was giving a raw type warning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I turned the raw warnings off, the project has thousands of those...
Thanks, GridPane is quite a useful layout, but if you want to hide a row or column, it is a huge pain currently (unless you use hgap/vgap of 0) as you need to physically renumber your rows/columns to collapse the extra gaps... |
|
huge pain, yes, that's why I am still working on https://github.com/andy-goryachev/FxDock/blob/master/doc/CPane.md |
:-) I created my own The above would produce an unaligned mess when the labels are different lengths, just like nesting HBoxes into VBox would. However, the Flex has a property "aligned" that you can set, and it will affect the layout of any nested flexes of the opposite type. In this case, if you give the top FlexV this property, the nested horizontal flexes will automatically align as if they were in a grid. It looks like this in code (in builder form): I actually only use |
This fixes a long standing bug with
GridPanewhere unmanaged nodes would still result in gaps being added between rows/columns even though nothing is rendered there. Take the following grid where dashes and pipes represent the vgaps and hgaps:Now, when both C and D are set to unmanaged (and invisible) the grid will still render the gaps:
Instead it should collapse the gap between row 0 and 2:
There are at least two relevant issues in JBS:
Screenshots
Simple application which can hide row 3:
Correct behavior when row 3 is hidden:
Behavior before this fix (note the double gap and extra grid line):
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1990/head:pull/1990$ git checkout pull/1990Update a local copy of the PR:
$ git checkout pull/1990$ git pull https://git.openjdk.org/jfx.git pull/1990/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1990View PR using the GUI difftool:
$ git pr show -t 1990Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1990.diff
Using Webrev
Link to Webrev Comment