Turn ime_in_progress_ off when composition text is nothing
This commit is contained in:
parent
7ca7ed0e4f
commit
7ac3697142
1 changed files with 12 additions and 0 deletions
|
@ -382,6 +382,12 @@ void text_box_base::handle_key_backspace(SDL_Keymod /*modifier*/, bool& handled)
|
|||
delete_selection();
|
||||
} else if(selection_start_) {
|
||||
delete_char(true);
|
||||
if(ime_in_progress_) {
|
||||
if(utf8::size(text_.text()) <= utf8::size(text_cached_)) {
|
||||
ime_in_progress_ = false;
|
||||
ime_length_ = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
fire(event::NOTIFY_MODIFIED, *this, nullptr);
|
||||
}
|
||||
|
@ -395,6 +401,12 @@ void text_box_base::handle_key_delete(SDL_Keymod /*modifier*/, bool& handled)
|
|||
delete_selection();
|
||||
} else if(selection_start_ < text_.get_length()) {
|
||||
delete_char(false);
|
||||
if(ime_in_progress_) {
|
||||
if(utf8::size(text_.text()) <= utf8::size(text_cached_)) {
|
||||
ime_in_progress_ = false;
|
||||
ime_length_ = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
fire(event::NOTIFY_MODIFIED, *this, nullptr);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue