-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Expose and rename ItemList's _check_shape_changed
to force_update_list_size
#63634
Expose and rename ItemList's _check_shape_changed
to force_update_list_size
#63634
Conversation
4c09602
to
4f1b4a4
Compare
9b31eb8
to
569f778
Compare
Its probably better with this PR to also expose the auto_height_value as a getter, as in cases where auto_height is false its impossible to tell what the current is still without introducing code smells: (and it still calculates it regardless of auto_height) # changed list without auto_height enabled
force_update_list_size()
auto_height = true
var height = get_minimum_size().y
auto_height = false
# ... But if auto_height_value is exposed and updates could be forced then both the code and documentation becomes more readable and doesn't require this janky solution: # changed list without auto_height enabled
force_update_list_size()
var height = get_auto_height()
# ... |
The PR looks ok. I guess it doesn't hurt to add the new function if it has some uses (and it's huge, so replicating it isn't exactly simple). The other function you mention has easy workaround and is rather specific, so it should be added in another PR if anything (and probably needs separate proposal). I'm wondering if the name can't be better though. Maybe it should be |
aa48ad5
to
7e45c7e
Compare
update_for_items
update_auto_height
7e45c7e
to
c51d5e1
Compare
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 think the method description might still need an improvement, but I don't have any suggestion. Other than that the PR looks ok.
e24bad9
to
02f2fc5
Compare
The CI failure was my fault (now fixed), will need a rebase to solve it. |
02f2fc5
to
033ce9e
Compare
033ce9e
to
d143fa3
Compare
d143fa3
to
3cde7cd
Compare
I'm not exactly sure what would be the best recommendation for this as of a2a524d, as that accomplishes majorly the same functionality except it doesn't expose it, which is fine, but would it be better to rename |
@Spartan322 If we're exposing it, it can be named There is no reason to have different names publicly and privately, so you can can just rename the method and make it public, and expose it with the same name to the API. |
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.
See above.
29a926c
to
11e3490
Compare
update_auto_height
_check_shape_changed
to force_update_list_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.
Other than the docs, this seems fine to me.
Rename ItemList::_check_shape_changed to force_update_list_size `force_update_list_size` is especially useful for updating the auto_height_value early
11e3490
to
421e8c5
Compare
Thanks! |
Closes godotengine/godot-proposals#254
Exposes
force_update_list_size
to allow users to update auto_height_value early before draw if shape_changed is true, can be retrieved viaget_minimum_size()
.Exposed Additions
ItemList: