From 41d7a62457a48d7d76a226bb7bd3d562500dddc2 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 10 Feb 2021 00:38:55 +0100 Subject: Its all so tiresome --- src/plugins/Matrix.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp index d3e8117..a47b588 100644 --- a/src/plugins/Matrix.cpp +++ b/src/plugins/Matrix.cpp @@ -418,8 +418,8 @@ namespace QuickMedia { void body_set_selected_item(Body *body, BodyItem *selected_item) { for(size_t i = 0; i < body->items.size(); ++i) { if(body->items[i]->url == selected_item->url) { - body->set_selected_item(i); - body->reset_prev_selected_item(); + body->select_first_item(); + body->set_selected_item(i, false); return; } } @@ -683,8 +683,10 @@ namespace QuickMedia { body->items.insert(body->items.begin() + i, std::move(body_item_to_insert)); else 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->set_selected_item(selected_item + 1); + 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); + } return; } } -- cgit v1.2.3