Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2013-05-11 00:34:35 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-05-11 00:34:35 +0400
commit38391d9a7dd0406252f2ff0b525950929a79ac58 (patch)
tree8bca86c18506f3418a318594344d19e9c653dbbb /source/blender/editors/interface/interface_widgets.c
parent50b270ca362e0bac8c20dd9e8226e7b23a550d20 (diff)
Fix #35281: search menu buttons (with an X on the right side to clear) had text
overlapping the X icon if the text was long.
Diffstat (limited to 'source/blender/editors/interface/interface_widgets.c')
-rw-r--r--source/blender/editors/interface/interface_widgets.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index 4d529a847a5..bbc528a0a18 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -968,8 +968,14 @@ static void ui_text_clip_give_next_off(uiBut *but)
static void ui_text_clip_left(uiFontStyle *fstyle, uiBut *but, const rcti *rect)
{
int border = (but->flag & UI_BUT_ALIGN_RIGHT) ? 8 : 10;
- int okwidth = max_ii(BLI_rcti_size_x(rect) - border, 0);
- if (but->flag & UI_HAS_ICON) okwidth -= UI_DPI_ICON_SIZE;
+ int okwidth = BLI_rcti_size_x(rect) - border;
+
+ if (but->flag & UI_HAS_ICON)
+ okwidth -= UI_DPI_ICON_SIZE;
+ if (but->type == SEARCH_MENU_UNLINK && !but->editstr)
+ okwidth -= BLI_rcti_size_y(rect);
+
+ okwidth = max_ii(okwidth, 0);
/* need to set this first */
uiStyleFontSet(fstyle);
@@ -1347,7 +1353,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->drawstr[0]) {
+ if (but->type == SEARCH_MENU_UNLINK && !but->editstr && but->drawstr[0]) {
rcti temp = *rect;
temp.xmin = temp.xmax - (BLI_rcti_size_y(rect) * 1.08f);