fix: tristate toggle logic for tab visibilty (#5530)

Co-authored-by: Nerixyz <nerixdev@outlook.de>
This commit is contained in:
pajlada
2024-08-24 11:42:42 +02:00
committed by GitHub
parent f36c73019d
commit 5170085d7c
14 changed files with 326 additions and 199 deletions
+21
View File
@@ -127,6 +127,27 @@ public:
this->itemsChanged_();
}
bool removeFirstMatching(std::function<bool(const T &)> matcher,
void *caller = nullptr)
{
assertInGuiThread();
for (int index = 0; index < this->items_.size(); ++index)
{
T item = this->items_[index];
if (matcher(item))
{
this->items_.erase(this->items_.begin() + index);
SignalVectorItemEvent<T> args{item, index, caller};
this->itemRemoved.invoke(args);
this->itemsChanged_();
return true;
}
}
return false;
}
const std::vector<T> &raw() const
{
assertInGuiThread();