fix [#37078] Search props don't react on click at the right end (where 'X' is if field not empty)

This commit is contained in:
2013-10-15 00:24:53 +00:00
parent f9f2e20739
commit d4cf5e3605
3 changed files with 13 additions and 3 deletions

View File

@@ -961,7 +961,7 @@ static void ui_text_clip_left(uiFontStyle *fstyle, uiBut *but, const rcti *rect)
if (but->flag & UI_HAS_ICON)
okwidth -= UI_DPI_ICON_SIZE;
if (but->type == SEARCH_MENU_UNLINK && !but->editstr)
if ((but->type == SEARCH_MENU_UNLINK) && ui_is_but_search_unlink_visible(but))
okwidth -= BLI_rcti_size_y(rect);
okwidth = max_ii(okwidth, 0);
@@ -1325,7 +1325,7 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB
}
/* unlink icon for this button type */
if (but->type == SEARCH_MENU_UNLINK && !but->editstr && but->drawstr[0]) {
if ((but->type == SEARCH_MENU_UNLINK) && ui_is_but_search_unlink_visible(but)) {
rcti temp = *rect;
temp.xmin = temp.xmax - (BLI_rcti_size_y(rect) * 1.08f);