We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 917fd65 + c09a5e2 commit 694baffCopy full SHA for 694baff
scene/gui/button.cpp
@@ -258,7 +258,8 @@ void Button::_notification(int p_what) {
258
259
if (expand_icon) {
260
Size2 _size = get_size() - style->get_offset() * 2;
261
- _size.width -= get_theme_constant(SNAME("h_separation")) + icon_ofs_region;
+ int icon_text_separation = text.is_empty() ? 0 : get_theme_constant(SNAME("h_separation"));
262
+ _size.width -= icon_text_separation + icon_ofs_region;
263
if (!clip_text && icon_align_rtl_checked != HORIZONTAL_ALIGNMENT_CENTER) {
264
_size.width -= text_buf->get_size().width;
265
}
0 commit comments