### Godot version

v4.1.stable.official [970459615]

### System information

Windows 10

### Issue description

When changing the `file_mode` of `FileDialog` from "Open File" to "Save File" via code the "Save" button keeps disabled until a file or folder is selected if the "Open" button was disabled before.

Basically the button activity has to be updated when `file_mode` is changed. I have made the change already but the last time I opened an PR without an issue some people requested I open one. So here you are!

### Steps to reproduce

- Open the MRP and start it
- click anywere to open the dialog
- after 10 seconds the dialog changes file_mode
- if the button is disabled before the change it is as well after it

### Minimal reproduction project

[file_dialogue_test.zip](https://github.com/godotengine/godot/files/11991311/file_dialogue_test.zip)

return show_hidden_files;
}
void FileDialog::set_default_show_hidden_files(bool p_show) {
	default_show_hidden_files = p_show;
}
FileDialog::FileDialog() {
	show_hidden_files = default_show_hidden_files;
	vbox = memnew(VBoxContainer);
	add_child(vbox, false, INTERNAL_MODE_FRONT);
	mode = FILE_MODE_SAVE_FILE;
	set_title(TTRC("Save a File"));
	HBoxContainer *hbc = memnew(HBoxContainer);
	dir_prev = memnew(Button);
	dir_prev->set_flat(true);
	dir_prev->set_tooltip_text(RTR("Go to previous folder."));
	dir_next = memnew(Button);
	dir_next->set_flat(true);
	dir_next->set_tooltip_text(RTR("Go to next folder."));
	dir_up = memnew(Button);
	dir_up->set_flat(true);
	dir_up->set_tooltip_text(RTR("Go to parent folder."));
	hbc->add_child(dir_prev);
	hbc->add_child(dir_next);
	hbc->add_child(dir_up);
	dir_prev->connect("pressed", callable_mp(this, &FileDialog::_go_back));
	dir_next->connect("pressed", callable_mp(this, &FileDialog::_go_forward));
	dir_up->connect("pressed", callable_mp(this, &FileDialog::_go_up));
	hbc->add_child(memnew(Label(RTR("Path:"))));
	drives_container = memnew(HBoxContainer);
	hbc->add_child(drives_container);