| 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/panel_container.h" |
| 34 |
|
| 35 |
class BoxContainer; |
| 36 |
class Button; |
| 37 |
class TextureRect; |
| 38 |
|
| 39 |
class TouchActionsPanel : public PanelContainer { |
| 40 |
GDCLASS(TouchActionsPanel, PanelContainer); |
| 41 |
|
| 42 |
private: |
| 43 |
BoxContainer *box = nullptr; |
| 44 |
Button *save_button = nullptr; |
| 45 |
Button *delete_button = nullptr; |
| 46 |
Button *undo_button = nullptr; |
| 47 |
Button *redo_button = nullptr; |
| 48 |
Button *cut_button = nullptr; |
| 49 |
Button *copy_button = nullptr; |
| 50 |
Button *paste_button = nullptr; |
| 51 |
|
| 52 |
TextureRect *drag_handle = nullptr; |
| 53 |
Button *layout_toggle_button = nullptr; |
| 54 |
Button *lock_panel_button = nullptr; |
| 55 |
Button *panel_pos_button = nullptr; |
| 56 |
|
| 57 |
bool locked_panel = false; |
| 58 |
bool dragging = false; |
| 59 |
Vector2 drag_offset; |
| 60 |
|
| 61 |
enum Modifier { |
| 62 |
MODIFIER_CTRL, |
| 63 |
MODIFIER_SHIFT, |
| 64 |
MODIFIER_ALT |
| 65 |
}; |
| 66 |
|
| 67 |
bool ctrl_btn_pressed = false; |
| 68 |
bool shift_btn_pressed = false; |
| 69 |
bool alt_btn_pressed = false; |
| 70 |
|
| 71 |
bool is_floating = false; |
| 72 |
int embedded_panel_index = 0; |
| 73 |
|
| 74 |
void _notification(int p_what); |
| 75 |
virtual void input(const Ref<InputEvent> &event) override; |
| 76 |
|
| 77 |
void _simulate_editor_shortcut(const String &p_shortcut_name); |
| 78 |
void _simulate_key_press(Key p_keycode); |
| 79 |
void _on_drag_handle_gui_input(const Ref<InputEvent> &p_event); |
| 80 |
void _switch_layout(); |
| 81 |
void _lock_panel_toggled(bool p_pressed); |
| 82 |
void _switch_embedded_panel_side(); |
| 83 |
|
| 84 |
Button *_add_new_action_button(const String &p_shortcut, const String &p_name, Key p_keycode = Key::NONE); |
| 85 |
void _add_new_modifier_button(Modifier p_modifier); |
| 86 |
void _on_modifier_button_toggled(bool p_pressed, int p_modifier); |
| 87 |
|
| 88 |
void _hardware_keyboard_connected(bool p_connected); |
| 89 |
|
| 90 |
public: |
| 91 |
TouchActionsPanel(); |
| 92 |
}; |