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

Add compatibility rename of (v)align properties of Label #82894

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions scene/gui/label.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,19 @@ Size2 Label::get_minimum_size() const {
}
}

#ifndef DISABLE_DEPRECATED
bool Label::_set(const StringName &p_name, const Variant &p_value) {
if (p_name == SNAME("valign")) {
set_vertical_alignment((VerticalAlignment)p_value.operator int());
return true;
} else if (p_name == SNAME("align")) {
set_horizontal_alignment((HorizontalAlignment)p_value.operator int());
return true;
}
return false;
}
#endif

int Label::get_line_count() const {
if (!is_inside_tree()) {
return 1;
Expand Down
3 changes: 3 additions & 0 deletions scene/gui/label.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ class Label : public Control {
protected:
void _notification(int p_what);
static void _bind_methods();
#ifndef DISABLE_DEPRECATED
bool _set(const StringName &p_name, const Variant &p_value);
#endif

public:
virtual Size2 get_minimum_size() const override;
Expand Down
Loading