1
0
mirror of synced 2024-11-14 18:47:41 +01:00

make copies of panels instead of moving them when creating layouts

This commit is contained in:
Stepland 2020-03-04 00:23:19 +01:00
parent f9e91a9298
commit 4eef5d62fc

View File

@ -13,11 +13,7 @@ namespace MusicSelect {
current_column.emplace_back(std::make_shared<CategoryPanel>(resources, category));
for (auto& panel : panels) {
if (current_column.size() == 3) {
push_back({
std::move(current_column[0]),
std::move(current_column[1]),
std::move(current_column[2]),
});
push_back({current_column[0],current_column[1],current_column[2]});
current_column.clear();
}
current_column.push_back(panel);
@ -26,11 +22,7 @@ namespace MusicSelect {
while (current_column.size() < 3) {
current_column.emplace_back(std::make_shared<EmptyPanel>(resources));
}
push_back({
std::move(current_column[0]),
std::move(current_column[1]),
std::move(current_column[2]),
});
push_back({current_column[0],current_column[1],current_column[2]});
}
}
}
@ -44,11 +36,7 @@ namespace MusicSelect {
std::vector<std::shared_ptr<Panel>> current_column;
for (auto& panel : panels) {
if (current_column.size() == 3) {
push_back({
std::move(current_column[0]),
std::move(current_column[1]),
std::move(current_column[2]),
});
push_back({current_column[0],current_column[1],current_column[2]});
current_column.clear();
}
current_column.push_back(panel);
@ -57,11 +45,7 @@ namespace MusicSelect {
while (current_column.size() < 3) {
current_column.emplace_back(std::make_shared<EmptyPanel>(resources));
}
push_back({
std::move(current_column[0]),
std::move(current_column[1]),
std::move(current_column[2]),
});
push_back({current_column[0],current_column[1],current_column[2]});
}
fill_layout(resources);
}