diff options
author | dec05eba <dec05eba@protonmail.com> | 2023-12-16 16:07:13 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2023-12-16 16:07:13 +0100 |
commit | 7b91566f303b4afd2deeb6c893ee805e4d62fdaf (patch) | |
tree | 96d66d2f5c0bdb2396c6f19b8702c18a5de3ea54 /src | |
parent | 87d04fdf4592a0b306852e16eb8fb68c2fd65c31 (diff) |
Matrix: keep chat message when pressing esc or going back to previous page. Press ctrl+d to remove text instead (in input mode)
Diffstat (limited to 'src')
-rw-r--r-- | src/QuickMedia.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index 99e68df..7b052f4 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -6011,6 +6011,7 @@ namespace QuickMedia { Entry chat_input("Press i to start writing a message...", &rounded_rectangle_shader); chat_input.set_editable(false); chat_input.set_padding_scale(1.5f); + chat_input.set_text(current_room->chat_message); struct ProvisionalMessage { std::shared_ptr<BodyItem> body_item; @@ -7438,7 +7439,6 @@ namespace QuickMedia { mention.hide(); } else { chat_input.set_editable(false); - chat_input.set_text(""); chat_state = ChatState::NAVIGATING; currently_operating_on_item = nullptr; if(typing && current_room) { @@ -7512,11 +7512,6 @@ namespace QuickMedia { if(chat_state == ChatState::REPLYING) chat_input.set_editable(true); } else { - mention.hide(); - chat_input.set_editable(false); - chat_input.set_text(""); - chat_state = ChatState::NAVIGATING; - currently_operating_on_item = nullptr; if(typing && current_room) { fprintf(stderr, "Stopped typing\n"); typing = false; @@ -7968,6 +7963,7 @@ namespace QuickMedia { } chat_page_end: + current_room->chat_message = chat_input.get_text(); matrix_chat_page->set_current_room(nullptr, nullptr, nullptr); fetch_messages_future.cancel(); cleanup_tasks(); |