aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/Matrix.cpp10
1 files changed, 6 insertions, 4 deletions
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;
}
}