IME: Disable IME for number buttons
This commit is contained in:
parent
7d5d971dea
commit
573783259d
Notes:
blender-bot
2023-02-14 09:23:51 +01:00
Referenced by issue #55507, Add missing font Referenced by issue #43944, crash on save Referenced by issue #43940, Color piker missing Referenced by issue #43920, Using IME with number buttons leads to crash
|
@ -2493,6 +2493,7 @@ static void ui_textedit_begin(bContext *C, uiBut *but, uiHandleButtonData *data)
|
|||
{
|
||||
wmWindow *win = CTX_wm_window(C);
|
||||
int len;
|
||||
const bool is_num_but = ELEM(but->type, UI_BTYPE_NUM, UI_BTYPE_NUM_SLIDER);
|
||||
|
||||
if (data->str) {
|
||||
MEM_freeN(data->str);
|
||||
|
@ -2520,7 +2521,7 @@ static void ui_textedit_begin(bContext *C, uiBut *but, uiHandleButtonData *data)
|
|||
BLI_str_rstrip_float_zero(data->str, '\0');
|
||||
}
|
||||
|
||||
if (ELEM(but->type, UI_BTYPE_NUM, UI_BTYPE_NUM_SLIDER)) {
|
||||
if (is_num_but) {
|
||||
ui_but_convert_to_unit_alt_name(but, data->str, data->maxlen);
|
||||
}
|
||||
|
||||
|
@ -2551,7 +2552,9 @@ static void ui_textedit_begin(bContext *C, uiBut *but, uiHandleButtonData *data)
|
|||
WM_cursor_modal_set(win, BC_TEXTEDITCURSOR);
|
||||
|
||||
#ifdef WITH_INPUT_IME
|
||||
ui_textedit_ime_begin(win, but);
|
||||
if (is_num_but == false) {
|
||||
ui_textedit_ime_begin(win, but);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue