aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-02-10 00:38:55 +0100
committerdec05eba <dec05eba@protonmail.com>2021-02-10 00:38:55 +0100
commit41d7a62457a48d7d76a226bb7bd3d562500dddc2 (patch)
treeb245356b8e338fc4261e28435cd802e58cb071f1 /src
parente1bbef2d64de09e0eef88410d69ac772d34d79ad (diff)
Its all so tiresome
Diffstat (limited to 'src')
-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;
}
}