### 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)

int lp = file->get_text().rfind(".");
	if (lp != -1) {
		file->select(0, lp);
		if (file->is_inside_tree() && !get_tree()->is_node_being_edited(file)) {
			file->grab_focus();
		}
	}
}
VBoxContainer *FileDialog::get_vbox() {
	return vbox;
}
void FileDialog::_update_theme_item_cache() {
	ConfirmationDialog::_update_theme_item_cache();
	theme_cache.parent_folder = get_theme_icon(SNAME("parent_folder"));
	theme_cache.forward_folder = get_theme_icon(SNAME("forward_folder"));
	theme_cache.back_folder = get_theme_icon(SNAME("back_folder"));
	theme_cache.reload = get_theme_icon(SNAME("reload"));
	theme_cache.toggle_hidden = get_theme_icon(SNAME("toggle_hidden"));
	theme_cache.folder = get_theme_icon(SNAME("folder"));
	theme_cache.file = get_theme_icon(SNAME("file"));
	theme_cache.folder_icon_color = get_theme_color(SNAME("folder_icon_color"));
	theme_cache.file_icon_color = get_theme_color(SNAME("file_icon_color"));
	theme_cache.file_disabled_color = get_theme_color(SNAME("file_disabled_color"));
	
	theme_cache.icon_normal_color = get_theme_color(SNAME("font_color"), SNAME("Button"));
	theme_cache.icon_hover_color = get_theme_color(SNAME("font_hover_color"), SNAME("Button"));
	theme_cache.icon_focus_color = get_theme_color(SNAME("font_focus_color"), SNAME("Button"));
	theme_cache.icon_pressed_color = get_theme_color(SNAME("font_pressed_color"), SNAME("Button"));
}
void FileDialog::_notification(int p_what) {