Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_widgets.c
| Context not available. | |||||
| int drawstr_left_len = UI_MAX_DRAW_STR; | int drawstr_left_len = UI_MAX_DRAW_STR; | ||||
| const char *drawstr = but->drawstr; | const char *drawstr = but->drawstr; | ||||
| const char *drawstr_right = NULL; | const char *drawstr_right = NULL; | ||||
| bool use_right_only = false; | bool use_right_only = false, use_left_only = false; | ||||
| uiStyleFontSet(fstyle); | uiStyleFontSet(fstyle); | ||||
| Context not available. | |||||
| uiBut *but_edit = ui_get_but_drag_multi_edit(but); | uiBut *but_edit = ui_get_but_drag_multi_edit(but); | ||||
| if (but_edit) { | if (but_edit) { | ||||
| drawstr = but_edit->editstr; | drawstr = but_edit->editstr; | ||||
| fstyle->align = UI_STYLE_TEXT_LEFT; | fstyle->align = UI_STYLE_TEXT_LEFT; /* XXX not needed?! */ | ||||
| use_left_only = true; | |||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| Context not available. | |||||
| * we rely on string being NULL terminated. */ | * we rely on string being NULL terminated. */ | ||||
| drawstr_left_len = INT_MAX; | drawstr_left_len = INT_MAX; | ||||
| drawstr = but->editstr; | drawstr = but->editstr; | ||||
| use_left_only = true; | |||||
| } | } | ||||
| } | } | ||||
| Context not available. | |||||
| } | } | ||||
| #ifdef USE_NUMBUTS_LR_ALIGN | #ifdef USE_NUMBUTS_LR_ALIGN | ||||
| if (!drawstr_right && ELEM(but->type, NUM, NUMSLI) && | if (!drawstr_right && ELEM(but->type, NUM, NUMSLI) && !use_left_only) | ||||
| /* if we're editing or multi-drag (fake editing), then use left alignment */ | /* if we're editing or multi-drag (fake editing), then use left alignment */ | ||||
| (but->editstr == NULL) && (drawstr == but->drawstr)) | |||||
| { | { | ||||
| drawstr_right = strchr(drawstr + but->ofs, ':'); | drawstr_right = strchr(drawstr + but->ofs, ':'); | ||||
| if (drawstr_right) { | if (drawstr_right) { | ||||
| Context not available. | |||||