summaryrefslogtreecommitdiffstats
path: root/scene/gui/line_edit.h
diff options
context:
space:
mode:
authorMounir Tohami <53877170+WhalesState@users.noreply.github.com>2024-09-10 13:43:31 +0000
committerMounir Tohami <53877170+WhalesState@users.noreply.github.com>2024-09-10 13:43:31 +0000
commitc36f466a4c1405427d3f2c60f4e0ad961a136ca3 (patch)
treed8f5d607d7fdcd5076a38484374b46e1f1a5132c /scene/gui/line_edit.h
parentd0dc3896ad6fe039e4ad0607d901c81197cb3a3b (diff)
downloadredot-engine-c36f466a4c1405427d3f2c60f4e0ad961a136ca3.tar.gz
Prevent `LineEdit` from losing focus when text is submitted or rejected.
Diffstat (limited to 'scene/gui/line_edit.h')
-rw-r--r--scene/gui/line_edit.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/scene/gui/line_edit.h b/scene/gui/line_edit.h
index 993bc727e4..984512745a 100644
--- a/scene/gui/line_edit.h
+++ b/scene/gui/line_edit.h
@@ -86,6 +86,7 @@ public:
private:
HorizontalAlignment alignment = HORIZONTAL_ALIGNMENT_LEFT;
+ bool editing = false;
bool editable = false;
bool pass = false;
bool text_changed_dirty = false;
@@ -205,6 +206,9 @@ private:
float base_scale = 1.0;
} theme_cache;
+ void _edit();
+ void _unedit();
+
void _clear_undo_stack();
void _clear_redo();
void _create_undo_state();
@@ -257,6 +261,8 @@ protected:
virtual void gui_input(const Ref<InputEvent> &p_event) override;
public:
+ bool is_editing() const;
+
void set_horizontal_alignment(HorizontalAlignment p_alignment);
HorizontalAlignment get_horizontal_alignment() const;