-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
update Control
nodes' size when changing the _window size_ project settings
#7125
Comments
+1 I've also been bothered by this a bunch. I personally would file this as a bug, but it depends on why it's currently not behaving correctly.
There already exists |
the disagreement if this is a bug has been there since the comment where i asked about this issue for the very first time:
|
¡thank you! for finding this signal. i expected it to be in ProjectSettings. updatei failed to connect the signal through this code EditorPlugin.project_settings_changed.connect(
_on_project_settings_changed
) because of the error
but i found another way to optimise the script: updating the Control's size only in the editor: @tool
extends Control
func _process(_delta:float) -> void:
if Engine.is_editor_hint():
set_anchors_preset(Control.PRESET_FULL_RECT)
else:
set_script(null) ※ when adding the feature to Godot, the Control size should update only when changing the window size project settings. |
To be clear, is this only about the editor or both editor and running game? |
Is this essentially the same as godotengine/godot#69208 ? If so, I would prefer to close this in favor of that issue. |
yes, this is the same issue. the only real differences are:
i didn't find this duplicate myself because i didn't think of looking for bug reports when i looked for duplicates. |
@sosasees In this particular case, however, it doesn't update or require an action for the setting to update, instead nothing happens and the setting is not updated. This leads me to believe that we're dealing with a bug, not a situation where we're discussing a new feature request. |
this makes sense, now i know why this is a bug. |
closed in favor of godotengine/godot#69208 |
Describe the project you are working on
a GUI application
Describe the problem or limitation you are having in your project
when changing the window size project settings, i can't see if the new window size is better (or worse) for the layout until i close the project settings and reselect the root Control node's anchor preset.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
if the Controls update their size when changing the window size project settings, i can check how the new window size affects the opened scene instantly, instead of having to close the project settings and reselect the scene root Control's anchor preset first.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
when changing the project setting
display/window/size/viewport_width
ordisplay/window/size/viewport_height
, every Control that is a scene root or CanvasLayer child updates its size.If this enhancement will not be used often, can it be worked around with a few lines of script?
i can add a tool script to the Control that is a scene root or CanvasLayer child, that resets its anchor preset every frame:
※ you could choose any LayoutPreset in place of
PRESET_FULL_RECT
, but my responsive UI plugin (version 1.1.0) choosesPRESET_FULL_RECT
for its FullRectControl node typeIs there a reason why this should be core and not an add-on in the asset library?
this is a very useful (and expected) quality-of-life feature,
and it would be much more useful if
∗ maybe i could change the script to only update the size when changing the window size project settings, if Godot adds the signal
ProjectSettings
.setting_changed( name:
String
)
The text was updated successfully, but these errors were encountered: