diff options
author | Matt Ebb <matt@mke3.net> | 2010-01-14 12:56:41 +0300 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2010-01-14 12:56:41 +0300 |
commit | e8c4be18a84456301204f27082aed9bd8933eb77 (patch) | |
tree | b47c665e55c85edbc781db460bb66686b6502011 /source/blender/editors | |
parent | 6b0e2ecd6c739a176e8d48eabebfa8af5aca11ed (diff) |
Fix [#20029] Text input fields with dropdown list bugs
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/interface/interface.c | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 5 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 9 |
3 files changed, 11 insertions, 5 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 7a1cc4f5bad..72502dd018f 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1360,7 +1360,7 @@ void ui_set_but_val(uiBut *but, double value) int ui_get_but_string_max_length(uiBut *but) { - if(but->type == TEX) + if(ELEM(but->type, TEX, SEARCH_MENU)) return but->hardmax; else if(but->type == IDPOIN) return sizeof(((ID*)NULL)->name)-2; diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 705decec70d..75b03e0069d 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -1083,8 +1083,11 @@ static void ui_textedit_set_cursor_pos(uiBut *but, uiHandleButtonData *data, sho /* XXX solve generic */ if(but->type==NUM || but->type==NUMSLI) startx += (int)(0.5f*(but->y2 - but->y1)); - else if(but->type==TEX) + else if(ELEM(but->type, TEX, SEARCH_MENU)) { startx += 5; + if (but->flag & UI_HAS_ICON) + startx += 16; + } /* XXX does not take zoom level into account */ while((BLF_width(origstr+but->ofs) + startx) > x) { diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 7b975d17184..575f298b3cd 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -804,6 +804,8 @@ static void ui_text_leftclip(uiFontStyle *fstyle, uiBut *but, rcti *rect) int border= (but->flag & UI_BUT_ALIGN_RIGHT)? 8: 10; int okwidth= rect->xmax-rect->xmin - border; + if (but->flag & UI_HAS_ICON) okwidth -= 16; + /* need to set this first */ uiStyleFontSet(fstyle); @@ -984,7 +986,7 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB if (ELEM4(but->type, NUM, NUMABS, NUMSLI, SLI)) { ui_text_label_rightclip(fstyle, but, rect); } - else if (but->type == TEX) { + else if (ELEM(but->type, TEX, SEARCH_MENU)) { ui_text_leftclip(fstyle, but, rect); } else but->ofs= 0; @@ -1330,8 +1332,9 @@ static void widget_state(uiWidgetType *wt, int state) VECCOPY(wt->wcol.text, wt->wcol.text_sel); - /* swap for selection - show depressed */ - SWAP(short, wt->wcol.shadetop, wt->wcol.shadedown); + if (!(state & UI_TEXTINPUT)) + /* swap for selection - show depressed */ + SWAP(short, wt->wcol.shadetop, wt->wcol.shadedown); } else { if(state & UI_BUT_ANIMATED_KEY) |