mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
Fix editor spin slider remaining editable if set read_only during an edit and fix related animation player crash
(cherry picked from commit b6abb34759)
This commit is contained in:
committed by
Yuri Sizov
parent
7f1b1e1c1b
commit
12969aadbd
@@ -4631,6 +4631,10 @@ void AnimationTrackEditor::_update_scroll(double) {
|
||||
}
|
||||
|
||||
void AnimationTrackEditor::_update_step(double p_new_step) {
|
||||
if (animation.is_null()) {
|
||||
return;
|
||||
}
|
||||
|
||||
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
|
||||
undo_redo->create_action(TTR("Change Animation Step"));
|
||||
float step_value = p_new_step;
|
||||
|
||||
@@ -577,8 +577,13 @@ void EditorSpinSlider::_value_focus_exited() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (is_read_only()) {
|
||||
// Spin slider has become read only while it was being edited.
|
||||
return;
|
||||
}
|
||||
|
||||
_evaluate_input_text();
|
||||
// focus is not on the same element after the vlalue_input was exited
|
||||
// focus is not on the same element after the value_input was exited
|
||||
// -> focus is on next element
|
||||
// -> TAB was pressed
|
||||
// -> modal_close was not called
|
||||
@@ -608,6 +613,10 @@ void EditorSpinSlider::_grabber_mouse_exited() {
|
||||
|
||||
void EditorSpinSlider::set_read_only(bool p_enable) {
|
||||
read_only = p_enable;
|
||||
if (read_only && value_input) {
|
||||
value_input->release_focus();
|
||||
}
|
||||
|
||||
queue_redraw();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user