Fix: Icon alignment for scaled pie buttons with no text

This commit is contained in:
Aleksandr Zinovev 2017-06-20 20:15:04 +03:00
parent e3b1d562a7
commit 9e08019b74
2 changed files with 6 additions and 2 deletions

View File

@ -3168,7 +3168,9 @@ static uiBut *ui_def_but(
}
if (block->flag & UI_BLOCK_RADIAL) {
but->drawflag |= (UI_BUT_TEXT_LEFT | UI_BUT_ICON_LEFT);
but->drawflag |= UI_BUT_TEXT_LEFT;
if (but->str && but->str[0])
but->drawflag |= UI_BUT_ICON_LEFT;
}
else if ((block->flag & UI_BLOCK_LOOP) ||
ELEM(but->type,

View File

@ -2396,8 +2396,10 @@ static void ui_litem_layout_radial(uiLayout *litem)
/* add a little bit more here to include number */
bitem->but->rect.xmax += 1.5f * UI_UNIT_X;
/* enable drawing as pie item if supported by widget */
if (ui_item_is_radial_drawable(bitem))
if (ui_item_is_radial_drawable(bitem)) {
bitem->but->dt = UI_EMBOSS_RADIAL;
bitem->but->drawflag |= UI_BUT_ICON_LEFT;
}
}
ui_item_size(item, &itemw, &itemh);