Skip to content
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

#801 Add support to remove row from the GridPane #802

Merged
merged 5 commits into from
Sep 18, 2018

Conversation

zshamrock
Copy link
Contributor

@zshamrock zshamrock commented Sep 15, 2018

As well as remove all rows.

Currently I extend the GridPane manually in my own project https://github.com/zshamrock/dynoman/blob/master/src/main/kotlin/com/akazlou/dynoman/ext/Ext.kt, but would be nice to have these features as part of the TornadoFX package.

Please, let me know whether the provided PR looks good or make any necessary adjustments you feel like good doing.

*/
fun GridPane.removeRow(node: Node): Int {
if (properties.containsKey(GridPaneRowIdKey)) {
properties[GridPaneRowIdKey] = properties[GridPaneRowIdKey] as Int - 1
Copy link
Contributor Author

@zshamrock zshamrock Sep 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here the alternative implementation could be if the property value is 0, just to remove the property all together instead of subtract.

Although currently it doesn't matter, as in the current case it will result in -1, and when adding the new row the index will become 0, same as if the property were absent.

…ngle row

Thinking more it feels like the better approach to remove the property rather than going to -1 value.
@edvin
Copy link
Owner

edvin commented Sep 16, 2018

Thank you for your hard work. Let me know when you are ready to merge :)

@zshamrock
Copy link
Contributor Author

Hi, @edvin. Thank you! I am not planning to push any more changes. So if it looks good to you, feel free to proceed with the merge.

@edvin
Copy link
Owner

edvin commented Sep 17, 2018

Great! I will look at it in more detail ASAP and perform the merge! Thanks again :)

@edvin edvin merged commit b656f9a into edvin:master Sep 18, 2018
@edvin
Copy link
Owner

edvin commented Sep 18, 2018

Merged :)

zshamrock added a commit to zshamrock/dynoman that referenced this pull request Apr 19, 2019
As my pull request has been already merged to the TornadoFX edvin/tornadofx#802.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants