Merge pull request #80490 from YuriSizov/editor-scene-tabs-unchained
Extract editor scene tabs into their own component
This commit is contained in:
commit
2967084fe3
6 changed files with 552 additions and 369 deletions
|
|
@ -93,6 +93,7 @@ class EditorResourcePreview;
|
|||
class EditorResourceConversionPlugin;
|
||||
class EditorRunBar;
|
||||
class EditorRunNative;
|
||||
class EditorSceneTabs;
|
||||
class EditorSelectionHistory;
|
||||
class EditorSettingsDialog;
|
||||
class EditorTitleBar;
|
||||
|
|
@ -154,6 +155,8 @@ public:
|
|||
};
|
||||
|
||||
private:
|
||||
friend class EditorSceneTabs;
|
||||
|
||||
enum MenuOptions {
|
||||
FILE_NEW_SCENE,
|
||||
FILE_NEW_INHERITED_SCENE,
|
||||
|
|
@ -216,6 +219,7 @@ private:
|
|||
SETTINGS_PICK_MAIN_SCENE,
|
||||
SETTINGS_TOGGLE_FULLSCREEN,
|
||||
SETTINGS_HELP,
|
||||
|
||||
SCENE_TAB_CLOSE,
|
||||
|
||||
EDITOR_SCREENSHOT,
|
||||
|
|
@ -235,9 +239,6 @@ private:
|
|||
|
||||
SET_RENDERER_NAME_SAVE_AND_RESTART,
|
||||
|
||||
GLOBAL_NEW_WINDOW,
|
||||
GLOBAL_SCENE,
|
||||
|
||||
IMPORT_PLUGIN_BASE = 100,
|
||||
|
||||
TOOL_MENU_BASE = 1000
|
||||
|
|
@ -319,10 +320,7 @@ private:
|
|||
Vector<HSplitContainer *> hsplits;
|
||||
|
||||
// Main tabs.
|
||||
TabBar *scene_tabs = nullptr;
|
||||
PopupMenu *scene_tabs_context_menu = nullptr;
|
||||
Panel *tab_preview_panel = nullptr;
|
||||
TextureRect *tab_preview = nullptr;
|
||||
EditorSceneTabs *scene_tabs = nullptr;
|
||||
|
||||
int tab_closing_idx = 0;
|
||||
List<String> tabs_to_close;
|
||||
|
|
@ -437,11 +435,7 @@ private:
|
|||
int dock_popup_selected_idx = -1;
|
||||
int dock_select_rect_over_idx = -1;
|
||||
|
||||
PanelContainer *tabbar_panel = nullptr;
|
||||
HBoxContainer *tabbar_container = nullptr;
|
||||
Button *distraction_free = nullptr;
|
||||
Button *scene_tab_add = nullptr;
|
||||
Control *scene_tab_add_ph = nullptr;
|
||||
|
||||
Vector<BottomPanelItem> bottom_panel_items;
|
||||
PanelContainer *bottom_panel = nullptr;
|
||||
|
|
@ -566,7 +560,6 @@ private:
|
|||
void _save_editor_states(const String &p_file, int p_idx = -1);
|
||||
void _load_editor_plugin_states_from_config(const Ref<ConfigFile> &p_config_file);
|
||||
void _update_title();
|
||||
void _update_scene_tabs();
|
||||
void _version_control_menu_option(int p_idx);
|
||||
void _close_messages();
|
||||
void _show_messages();
|
||||
|
|
@ -578,11 +571,14 @@ private:
|
|||
|
||||
int _save_external_resources();
|
||||
|
||||
void _set_current_scene(int p_idx);
|
||||
void _set_current_scene_nocheck(int p_idx);
|
||||
bool _validate_scene_recursive(const String &p_filename, Node *p_node);
|
||||
void _save_scene(String p_file, int idx = -1);
|
||||
void _save_all_scenes();
|
||||
int _next_unsaved_scene(bool p_valid_filename, int p_start = 0);
|
||||
void _discard_changes(const String &p_str = String());
|
||||
void _scene_tab_closed(int p_tab);
|
||||
|
||||
void _inherit_request(String p_file);
|
||||
void _instantiate_request(const Vector<String> &p_files);
|
||||
|
|
@ -596,8 +592,6 @@ private:
|
|||
void _add_to_recent_scenes(const String &p_scene);
|
||||
void _update_recent_scenes();
|
||||
void _open_recent_scene(int p_idx);
|
||||
void _global_menu_scene(const Variant &p_tag);
|
||||
void _global_menu_new_window(const Variant &p_tag);
|
||||
void _dropped_files(const Vector<String> &p_files);
|
||||
void _add_dropped_files_recursive(const Vector<String> &p_files, String to_path);
|
||||
|
||||
|
|
@ -636,16 +630,9 @@ private:
|
|||
void _dock_floating_close_request(WindowWrapper *p_wrapper);
|
||||
void _dock_make_selected_float();
|
||||
void _dock_make_float(Control *p_control, int p_slot_index, bool p_show_window = true);
|
||||
void _scene_tab_changed(int p_tab);
|
||||
|
||||
void _proceed_closing_scene_tabs();
|
||||
bool _is_closing_editor() const;
|
||||
void _scene_tab_closed(int p_tab, int p_option = SCENE_TAB_CLOSE);
|
||||
void _scene_tab_hovered(int p_tab);
|
||||
void _scene_tab_exit();
|
||||
void _scene_tab_input(const Ref<InputEvent> &p_input);
|
||||
void _reposition_active_tab(int idx_to);
|
||||
void _thumbnail_done(const String &p_path, const Ref<Texture2D> &p_preview, const Ref<Texture2D> &p_small_preview, const Variant &p_udata);
|
||||
void _scene_tab_script_edited(int p_tab);
|
||||
|
||||
Dictionary _get_main_scene_state();
|
||||
void _set_main_scene_state(Dictionary p_state, Node *p_for_scene);
|
||||
|
|
@ -705,9 +692,6 @@ protected:
|
|||
static void _bind_methods();
|
||||
void _notification(int p_what);
|
||||
|
||||
int get_current_tab();
|
||||
void set_current_tab(int p_tab);
|
||||
|
||||
public:
|
||||
// Public for use with callable_mp.
|
||||
void _on_plugin_ready(Object *p_script, const String &p_activate_name);
|
||||
|
|
@ -764,6 +748,9 @@ public:
|
|||
|
||||
ProjectSettingsEditor *get_project_settings() { return project_settings_editor; }
|
||||
|
||||
void trigger_menu_option(int p_option, bool p_confirmed);
|
||||
bool has_previous_scenes() const;
|
||||
|
||||
void new_inherited_scene() { _menu_option_confirm(FILE_NEW_INHERITED_SCENE, false); }
|
||||
|
||||
void set_docks_visible(bool p_show);
|
||||
|
|
@ -849,8 +836,6 @@ public:
|
|||
|
||||
bool is_scene_open(const String &p_path);
|
||||
|
||||
void set_current_scene(int p_idx);
|
||||
|
||||
void setup_color_picker(ColorPicker *p_picker);
|
||||
|
||||
void request_instantiate_scene(const String &p_path);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue