diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2023-07-15 15:49:35 -0400 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2023-07-15 15:49:35 -0400 |
commit | f941ad1befc0049bb2c4be08cf76df0c09dc1016 (patch) | |
tree | 4036c442b038c5b10daab9361d182b34cdb8c24a /src/components | |
parent | 00524cefa29e80f0a9a80fd77bb6e1f4da024f65 (diff) | |
download | abaddon-portaudio-f941ad1befc0049bb2c4be08cf76df0c09dc1016.tar.gz abaddon-portaudio-f941ad1befc0049bb2c4be08cf76df0c09dc1016.zip |
clear input when exiting editing
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/chatinput.cpp | 4 | ||||
-rw-r--r-- | src/components/chatinput.hpp | 1 | ||||
-rw-r--r-- | src/components/chatwindow.cpp | 1 |
3 files changed, 6 insertions, 0 deletions
diff --git a/src/components/chatinput.cpp b/src/components/chatinput.cpp index 8ad0c3f..c88de49 100644 --- a/src/components/chatinput.cpp +++ b/src/components/chatinput.cpp @@ -497,6 +497,10 @@ void ChatInput::InsertText(const Glib::ustring &text) { m_input.Get().InsertText(text); } +void ChatInput::Clear() { + GetBuffer()->set_text(""); +} + Glib::RefPtr<Gtk::TextBuffer> ChatInput::GetBuffer() { return m_input.Get().GetBuffer(); } diff --git a/src/components/chatinput.hpp b/src/components/chatinput.hpp index a7ee27f..c98d935 100644 --- a/src/components/chatinput.hpp +++ b/src/components/chatinput.hpp @@ -129,6 +129,7 @@ public: ChatInput(); void InsertText(const Glib::ustring &text); + void Clear(); Glib::RefPtr<Gtk::TextBuffer> GetBuffer(); bool ProcessKeyPress(GdkEventKey *event); void AddAttachment(const Glib::RefPtr<Gio::File> &file); diff --git a/src/components/chatwindow.cpp b/src/components/chatwindow.cpp index 864d0c9..dcff656 100644 --- a/src/components/chatwindow.cpp +++ b/src/components/chatwindow.cpp @@ -349,6 +349,7 @@ void ChatWindow::StopEditing() { m_is_editing = false; m_editing_id = Snowflake::Invalid; m_input->StopEditing(); + m_input->Clear(); m_input_indicator->ClearCustom(); } |