aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-05-28 15:48:43 +0200
committerdec05eba <dec05eba@protonmail.com>2021-05-28 16:05:00 +0200
commit7b48ab891023d76de6b13b56a8d5e205f62bc37d (patch)
tree5863e129fd26bc2033d63b4f1ead25e25b83a4c2 /src/plugins
parent2421bf3a24cd64767da1dde387c9caa27320dfc8 (diff)
Improve body navigation
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/Matrix.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp
index de50049..552762a 100644
--- a/src/plugins/Matrix.cpp
+++ b/src/plugins/Matrix.cpp
@@ -614,7 +614,7 @@ namespace QuickMedia {
bool is_window_focused = program->is_window_focused();
RoomData *current_room = program->get_current_chat_room();
Body *chat_body = chat_page ? chat_page->chat_body : nullptr;
- bool set_room_as_unread = !is_window_focused || room != current_room || (!chat_body || !chat_body->is_last_item_fully_visible()) || (chat_page && !chat_page->messages_tab_visible);
+ bool set_room_as_unread = !is_window_focused || room != current_room || (!chat_body || chat_body->is_bottom_cut_off()) || (chat_page && !chat_page->messages_tab_visible);
std::string room_desc;
if(set_room_as_unread)
@@ -692,7 +692,7 @@ namespace QuickMedia {
body->items.insert(body->items.begin() + (i - 1), std::move(body_item_to_insert));
if((int)i < selected_item && room_body_index > selected_item && body->items.size() > 1 && i != body->items.size() - 1) {
body->select_first_item();
- body->set_selected_item(selected_item + 1, false);
+ body->select_next_item();
}
return;
}
@@ -719,6 +719,7 @@ namespace QuickMedia {
void MatrixRoomsPage::clear_search() {
search_bar->clear();
body->filter_search_fuzzy("");
+ body->select_first_item();
}
void MatrixRoomsPage::clear_data() {
@@ -1107,9 +1108,8 @@ namespace QuickMedia {
//int prev_selected_item = notifications_body->get_selected_item();
//notifications_body->items.push_back(notification_to_body_item(notifications_body, notification));
//notifications_body->set_selected_item(prev_selected_item - 1);
- int prev_selected_item = notifications_body->get_selected_item();
notifications_body->items.insert(notifications_body->items.begin(), notification_to_body_item(notifications_body, notification));
- notifications_body->set_selected_item(prev_selected_item + 1, false);
+ notifications_body->select_next_item();
}
void MatrixNotificationsPage::set_room_as_read(RoomData *room) {