diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-11-11 20:39:43 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-11-11 20:40:08 +0300 |
commit | 9cc51d8ea2b09f26b29874cdd946dce8d4651b86 (patch) | |
tree | 0301e9583266a41cffaf853cc5f3a8793c95b465 /source/blender/editors/space_file/file_draw.c | |
parent | 2ad223607861b9dcd4172c05c5115b1ef931fc4b (diff) |
UI: cleanup odd string-width check
Diffstat (limited to 'source/blender/editors/space_file/file_draw.c')
-rw-r--r-- | source/blender/editors/space_file/file_draw.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 81476a8ad76..6f63f315f74 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -128,12 +128,9 @@ void file_draw_buttons(const bContext *C, ARegion *ar) } /* Is there enough space for the execute / cancel buttons? */ - loadbutton = UI_fontstyle_string_width(sfile->params->title) + btn_margin; - if (loadbutton < btn_minw) { - loadbutton = MAX2(btn_minw, - btn_margin + UI_fontstyle_string_width(params->title)); - } - + loadbutton = UI_fontstyle_string_width(params->title) + btn_margin; + CLAMP_MIN(loadbutton, btn_minw); + if (available_w <= loadbutton + separator + input_minw || params->title[0] == 0) { loadbutton = 0; } |