mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-22 12:48:26 +02:00
Make sure inserting a new section doesn't change the selected section
This commit is contained in:
parent
49bbf3a4f6
commit
b6fcf0f69d
@ -472,6 +472,10 @@ int Menu::sectionNamed(const char *sectionName)
|
|||||||
if (it == sections.end() || *it != sectionName) {
|
if (it == sections.end() || *it != sectionName) {
|
||||||
sections.emplace(it, sectionName);
|
sections.emplace(it, sectionName);
|
||||||
links.emplace(links.begin() + idx);
|
links.emplace(links.begin() + idx);
|
||||||
|
// Make sure the selected section doesn't change.
|
||||||
|
if (idx <= iSection) {
|
||||||
|
iSection++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return idx;
|
return idx;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user