diff options
author | Danil Alexeev <danil@alexeev.xyz> | 2023-08-31 22:20:39 +0300 |
---|---|---|
committer | Danil Alexeev <danil@alexeev.xyz> | 2023-09-02 08:50:28 +0300 |
commit | c33ca26e178ca79d2801d35d1b6fc2b30fa1b684 (patch) | |
tree | 35ee5b876c3c75609fb2d083cb414ab825bacddd /editor/connections_dialog.h | |
parent | 549fcce5f8f7beace3e5c90e9bbe4335d4fd1476 (diff) | |
download | redot-engine-c33ca26e178ca79d2801d35d1b6fc2b30fa1b684.tar.gz |
Editor: Inspector and Signal docks improvements
Diffstat (limited to 'editor/connections_dialog.h')
-rw-r--r-- | editor/connections_dialog.h | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/editor/connections_dialog.h b/editor/connections_dialog.h index d728072c2e..b07b08ecc7 100644 --- a/editor/connections_dialog.h +++ b/editor/connections_dialog.h @@ -196,18 +196,27 @@ class ConnectionsDockTree : public Tree { class ConnectionsDock : public VBoxContainer { GDCLASS(ConnectionsDock, VBoxContainer); - // Right-click popup menu options. - enum SignalMenuOption { - CONNECT, - DISCONNECT_ALL, - COPY_NAME, - OPEN_DOCUMENTATION, + enum TreeItemType { + TREE_ITEM_TYPE_ROOT, + TREE_ITEM_TYPE_CLASS, + TREE_ITEM_TYPE_SIGNAL, + TREE_ITEM_TYPE_CONNECTION, }; + // Right-click context menu options. + enum ClassMenuOption { + CLASS_MENU_OPEN_DOCS, + }; + enum SignalMenuOption { + SIGNAL_MENU_CONNECT, + SIGNAL_MENU_DISCONNECT_ALL, + SIGNAL_MENU_COPY_NAME, + SIGNAL_MENU_OPEN_DOCS, + }; enum SlotMenuOption { - EDIT, - GO_TO_SCRIPT, - DISCONNECT, + SLOT_MENU_EDIT, + SLOT_MENU_GO_TO_METHOD, + SLOT_MENU_DISCONNECT, }; Node *selected_node = nullptr; @@ -216,6 +225,8 @@ class ConnectionsDock : public VBoxContainer { ConfirmationDialog *disconnect_all_dialog = nullptr; ConnectDialog *connect_dialog = nullptr; Button *connect_button = nullptr; + PopupMenu *class_menu = nullptr; + String class_menu_doc_class_name; PopupMenu *signal_menu = nullptr; PopupMenu *slot_menu = nullptr; LineEdit *search_box = nullptr; @@ -231,18 +242,20 @@ class ConnectionsDock : public VBoxContainer { void _tree_item_selected(); void _tree_item_activated(); - bool _is_item_signal(TreeItem &p_item); + TreeItemType _get_item_type(const TreeItem &p_item) const; bool _is_connection_inherited(Connection &p_connection); void _open_connection_dialog(TreeItem &p_item); void _open_edit_connection_dialog(TreeItem &p_item); - void _go_to_script(TreeItem &p_item); + void _go_to_method(TreeItem &p_item); + void _handle_class_menu_option(int p_option); + void _class_menu_about_to_popup(); void _handle_signal_menu_option(int p_option); void _signal_menu_about_to_popup(); void _handle_slot_menu_option(int p_option); void _slot_menu_about_to_popup(); - void _rmb_pressed(Vector2 p_position, MouseButton p_button); + void _rmb_pressed(const Ref<InputEvent> &p_event); void _close(); protected: |