| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
#pragma once |
| 32 |
|
| 33 |
#include "scene/gui/tab_container.h" |
| 34 |
|
| 35 |
class Button; |
| 36 |
class ConfigFile; |
| 37 |
class EditorDock; |
| 38 |
class EditorToaster; |
| 39 |
class HBoxContainer; |
| 40 |
|
| 41 |
class EditorBottomPanel : public TabContainer { |
| 42 |
GDCLASS(EditorBottomPanel, TabContainer); |
| 43 |
|
| 44 |
HBoxContainer *bottom_hbox = nullptr; |
| 45 |
Control *icon_spacer = nullptr; |
| 46 |
EditorToaster *editor_toaster = nullptr; |
| 47 |
Button *pin_button = nullptr; |
| 48 |
Button *expand_button = nullptr; |
| 49 |
Popup *layout_popup = nullptr; |
| 50 |
|
| 51 |
int previous_tab = -1; |
| 52 |
bool lock_panel_switching = false; |
| 53 |
LocalVector<EditorDock *> bottom_docks; |
| 54 |
HashMap<String, int> dock_offsets; |
| 55 |
|
| 56 |
LocalVector<Button *> legacy_buttons; |
| 57 |
void _on_button_visibility_changed(Button *p_button, EditorDock *p_dock); |
| 58 |
|
| 59 |
void _repaint(); |
| 60 |
void _on_tab_changed(int p_idx); |
| 61 |
void _pin_button_toggled(bool p_pressed); |
| 62 |
void _expand_button_toggled(bool p_pressed); |
| 63 |
void _update_center_split_offset(); |
| 64 |
EditorDock *_get_dock_from_control(Control *p_control) const; |
| 65 |
|
| 66 |
protected: |
| 67 |
void _notification(int p_what); |
| 68 |
|
| 69 |
public: |
| 70 |
void save_layout_to_config(Ref<ConfigFile> p_config_file, const String &p_section) const; |
| 71 |
void load_layout_from_config(Ref<ConfigFile> p_config_file, const String &p_section); |
| 72 |
|
| 73 |
Button *add_item(String p_text, Control *p_item, const Ref<Shortcut> &p_shortcut = nullptr, bool p_at_front = false); |
| 74 |
void remove_item(Control *p_item); |
| 75 |
void make_item_visible(Control *p_item, bool p_visible = true, bool p_ignore_lock = false); |
| 76 |
void hide_bottom_panel(); |
| 77 |
void toggle_last_opened_bottom_panel(); |
| 78 |
void set_expanded(bool p_expanded); |
| 79 |
void _theme_changed(); |
| 80 |
bool is_locked() const { return lock_panel_switching; } |
| 81 |
|
| 82 |
void set_bottom_panel_offset(int p_offset); |
| 83 |
int get_bottom_panel_offset(); |
| 84 |
|
| 85 |
EditorBottomPanel(); |
| 86 |
~EditorBottomPanel(); |
| 87 |
}; |