From a90f4e0b27ead8dc609522d772d6ede250b258dd Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 5 Nov 2020 16:46:06 +0100 Subject: Do not sort rooms after navigating back --- src/QuickMedia.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/QuickMedia.cpp') diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index f3aeda5..9bb5231 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -982,8 +982,14 @@ namespace QuickMedia { after_submit_handler(); if(tabs[selected_tab].page->clear_search_after_submit() && tabs[selected_tab].search_bar) { - tabs[selected_tab].search_bar->clear(); - tabs[selected_tab].search_bar->onTextUpdateCallback(""); + if(!tabs[selected_tab].search_bar->get_text().empty()) { + tabs[selected_tab].search_bar->clear(); + tabs[selected_tab].search_bar->onTextUpdateCallback(""); + } else { + int selected_item_index = tabs[selected_tab].body->get_selected_item(); + tabs[selected_tab].body->select_first_item(); + tabs[selected_tab].body->set_selected_item(selected_item_index, false); + } } if(tabs[selected_tab].page->is_single_page()) { @@ -1047,7 +1053,7 @@ namespace QuickMedia { current_page = PageType::CHAT; current_chat_room = matrix->get_room_by_id(selected_item->url); chat_page(static_cast(new_tabs[0].page.get()), current_chat_room); - select_body_item_by_room(tabs[selected_tab].body.get(), current_chat_room); + //select_body_item_by_room(tabs[selected_tab].body.get(), current_chat_room); current_chat_room = nullptr; } else { page_loop(new_tabs); -- cgit v1.2.3