Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_widgets.c
| Show First 20 Lines • Show All 1,963 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| 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; | ||||
| #ifdef WITH_INPUT_IME | #ifdef WITH_INPUT_IME | ||||
| const wmIMEData *ime_data; | const wmIMEData *ime_data; | ||||
| bool ime_candidatewin_use_cursor_pos = true; | |||||
| int ime_candidatewin_x, ime_candidatewin_y; | |||||
| #endif | #endif | ||||
| UI_fontstyle_set(fstyle); | UI_fontstyle_set(fstyle); | ||||
| eFontStyle_Align align; | eFontStyle_Align align; | ||||
| if (but->editstr || (but->drawflag & UI_BUT_TEXT_LEFT)) { | if (but->editstr || (but->drawflag & UI_BUT_TEXT_LEFT)) { | ||||
| align = UI_STYLE_TEXT_LEFT; | align = UI_STYLE_TEXT_LEFT; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | if ((but->selend - but->selsta) > 0) { | ||||
| immUniformColor4ubv(wcol->item); | immUniformColor4ubv(wcol->item); | ||||
| immRecti(pos, | immRecti(pos, | ||||
| rect->xmin + selsta_draw, | rect->xmin + selsta_draw, | ||||
| rect->ymin + U.pixelsize, | rect->ymin + U.pixelsize, | ||||
| min_ii(rect->xmin + selwidth_draw, rect->xmax - 2), | min_ii(rect->xmin + selwidth_draw, rect->xmax - 2), | ||||
| rect->ymax - U.pixelsize); | rect->ymax - U.pixelsize); | ||||
| immUnbindProgram(); | immUnbindProgram(); | ||||
| #ifdef WITH_INPUT_IME | |||||
| /* ime candidate window use selection position */ | |||||
| ime_candidatewin_use_cursor_pos = false; | |||||
| ime_candidatewin_x = rect->xmin + selsta_draw; | |||||
| ime_candidatewin_y = rect->ymin + U.pixelsize; | |||||
| #endif | |||||
| } | } | ||||
| } | } | ||||
| /* text cursor */ | /* text cursor */ | ||||
| but_pos_ofs = but->pos; | but_pos_ofs = but->pos; | ||||
| #ifdef WITH_INPUT_IME | #ifdef WITH_INPUT_IME | ||||
| /* if is ime compositing, move the cursor */ | /* if is ime compositing, move the cursor */ | ||||
| Show All 32 Lines | if (but->pos >= but->ofs) { | ||||
| but_cursor_shape.ymin, | but_cursor_shape.ymin, | ||||
| but_cursor_shape.xmax, | but_cursor_shape.xmax, | ||||
| but_cursor_shape.ymax); | but_cursor_shape.ymax); | ||||
| immUnbindProgram(); | immUnbindProgram(); | ||||
| } | } | ||||
| #ifdef WITH_INPUT_IME | #ifdef WITH_INPUT_IME | ||||
| if (ime_data && ime_data->composite_len) { | |||||
| /* ime cursor following */ | /* ime cursor following */ | ||||
| if (but->pos >= but->ofs) { | if (but->pos >= but->ofs) { | ||||
| ui_but_ime_reposition(but, but_cursor_shape.xmax + 5, but_cursor_shape.ymin + 3, false); | if (ime_candidatewin_use_cursor_pos) { | ||||
| ime_candidatewin_x = but_cursor_shape.xmax + 5; | |||||
| ime_candidatewin_y = but_cursor_shape.ymin + 3; | |||||
| } | } | ||||
| ui_but_ime_reposition(but, ime_candidatewin_x, ime_candidatewin_y, false); | |||||
| } | |||||
| if (ime_data && ime_data->composite_len) { | |||||
| /* composite underline */ | /* composite underline */ | ||||
| widget_draw_text_ime_underline(fstyle, wcol, but, rect, ime_data, drawstr); | widget_draw_text_ime_underline(fstyle, wcol, but, rect, ime_data, drawstr); | ||||
| } | } | ||||
| #endif | #endif | ||||
| } | } | ||||
| if (fstyle->kerning == 1) { | if (fstyle->kerning == 1) { | ||||
| BLF_disable(fstyle->uifont_id, BLF_KERNING_DEFAULT); | BLF_disable(fstyle->uifont_id, BLF_KERNING_DEFAULT); | ||||
| ▲ Show 20 Lines • Show All 3,330 Lines • Show Last 20 Lines | |||||