Merge pull request #92103 from timothyqiu/category-3.x
[3.x] Fix long category name display in Inspector
This commit is contained in:
commit
f2b059c9be
1 changed files with 3 additions and 1 deletions
|
@ -944,16 +944,18 @@ void EditorInspectorCategory::_notification(int p_what) {
|
||||||
if (icon.is_valid()) {
|
if (icon.is_valid()) {
|
||||||
w += hs + icon->get_width();
|
w += hs + icon->get_width();
|
||||||
}
|
}
|
||||||
|
w = MIN(w, get_size().width - hs * 2);
|
||||||
|
|
||||||
int ofs = (get_size().width - w) / 2;
|
int ofs = (get_size().width - w) / 2;
|
||||||
|
|
||||||
if (icon.is_valid()) {
|
if (icon.is_valid()) {
|
||||||
draw_texture(icon, Point2(ofs, (get_size().height - icon->get_height()) / 2).floor());
|
draw_texture(icon, Point2(ofs, (get_size().height - icon->get_height()) / 2).floor());
|
||||||
ofs += hs + icon->get_width();
|
ofs += hs + icon->get_width();
|
||||||
|
w -= hs + icon->get_width();
|
||||||
}
|
}
|
||||||
|
|
||||||
Color color = get_color("font_color", "Tree");
|
Color color = get_color("font_color", "Tree");
|
||||||
draw_string(font, Point2(ofs, font->get_ascent() + (get_size().height - font->get_height()) / 2).floor(), label, color, get_size().width);
|
draw_string(font, Point2(ofs, font->get_ascent() + (get_size().height - font->get_height()) / 2).floor(), label, color, w);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue