From 00524cefa29e80f0a9a80fd77bb6e1f4da024f65 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Sat, 15 Jul 2023 01:02:35 -0400 Subject: make editing inline, add up arrow shortcut --- src/components/chatinput.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/components/chatinput.cpp') diff --git a/src/components/chatinput.cpp b/src/components/chatinput.cpp index 28ed1ea..8ad0c3f 100644 --- a/src/components/chatinput.cpp +++ b/src/components/chatinput.cpp @@ -565,6 +565,16 @@ void ChatInput::StopReplying() { m_input.Get().get_style_context()->remove_class("replying"); } +void ChatInput::StartEditing(const Message &message) { + m_input.Get().grab_focus(); + m_input.Get().get_style_context()->add_class("editing"); + GetBuffer()->set_text(message.Content); +} + +void ChatInput::StopEditing() { + m_input.Get().get_style_context()->remove_class("editing"); +} + bool ChatInput::AddFileAsImageAttachment(const Glib::RefPtr &file) { try { const auto read_stream = file->read(); -- cgit v1.2.3