File tree Expand file tree Collapse file tree 4 files changed +10
-6
lines changed Expand file tree Collapse file tree 4 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -515,7 +515,7 @@ void GroupsEditor::_confirm_add() {
515515	undo_redo->add_undo_method (SceneTreeDock::get_singleton ()->get_tree_editor (), " update_tree"  );
516516
517517	undo_redo->commit_action ();
518- 	tree->grab_focus ();
518+ 	tree->grab_focus (true );
519519}
520520
521521void  GroupsEditor::_confirm_rename () {
@@ -566,7 +566,7 @@ void GroupsEditor::_confirm_rename() {
566566
567567	undo_redo->commit_action ();
568568
569- 	tree->grab_focus ();
569+ 	tree->grab_focus (true );
570570}
571571
572572void  GroupsEditor::_confirm_delete () {
@@ -606,7 +606,7 @@ void GroupsEditor::_confirm_delete() {
606606	undo_redo->add_undo_method (this , " _update_tree"  );
607607
608608	undo_redo->commit_action ();
609- 	tree->grab_focus ();
609+ 	tree->grab_focus (true );
610610}
611611
612612void  GroupsEditor::_show_add_group_dialog () {
Original file line number Diff line number Diff line change @@ -275,6 +275,7 @@ void EditorSpinSlider::_value_input_gui_input(const Ref<InputEvent> &p_event) {
275275			case  Key::ESCAPE: {
276276				value_input_closed_frame = Engine::get_singleton ()->get_frames_drawn ();
277277				if  (value_input_popup) {
278+ 					value_input_focus_visible = value_input->has_focus (true );
278279					value_input_popup->hide ();
279280				}
280281			} break ;
@@ -610,6 +611,7 @@ void EditorSpinSlider::_evaluate_input_text() {
610611void  EditorSpinSlider::_value_input_submitted (const  String &p_text) {
611612	value_input_closed_frame = Engine::get_singleton ()->get_frames_drawn ();
612613	if  (value_input_popup) {
614+ 		value_input_focus_visible = value_input->has_focus (true );
613615		value_input_popup->hide ();
614616	}
615617}
@@ -644,9 +646,10 @@ void EditorSpinSlider::_value_focus_exited() {
644646			value_input_popup->hide ();
645647		}
646648	} else  {
647- 		//  Enter or Esc was pressed.
648- 		grab_focus ();
649+ 		//  Enter or Esc was pressed. Keep showing the focus if already present. 
650+ 		grab_focus (!value_input_focus_visible );
649651	}
652+ 	value_input_focus_visible = false ;
650653
651654	emit_signal (" value_focus_exited"  );
652655}
Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ class EditorSpinSlider : public Range {
6767	LineEdit *value_input = nullptr ;
6868	uint64_t  value_input_closed_frame = 0 ;
6969	bool  value_input_dirty = false ;
70+ 	bool  value_input_focus_visible = false ;
7071
7172public: 
7273	enum  ControlState {
Original file line number Diff line number Diff line change @@ -552,7 +552,7 @@ bool Viewport::_can_hide_focus_state() {
552552}
553553
554554void  Viewport::_on_settings_changed () {
555- 	if  (!gui.hide_focus  &&  _can_hide_focus_state ()) {
555+ 	if  (!gui.hide_focus  ||  _can_hide_focus_state ()) {
556556		return ;
557557	}
558558
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments