mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-11 19:58:49 -05:00
Add context menu option to expand / collapse all macro groups
This commit is contained in:
@@ -1181,6 +1181,16 @@ bool MacroTree::SelectionEmpty() const
|
||||
return selectedIndexes().empty();
|
||||
}
|
||||
|
||||
bool MacroTree::GroupsExist() const
|
||||
{
|
||||
for (const auto ¯o : GetMacros()) {
|
||||
if (macro->IsGroup()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void MacroTree::ExpandGroup(std::shared_ptr<Macro> item) const
|
||||
{
|
||||
auto *mtm = GetModel();
|
||||
@@ -1293,6 +1303,26 @@ void MacroTree::UngroupSelectedGroups()
|
||||
assert(GetModel()->IsInValidState());
|
||||
}
|
||||
|
||||
void MacroTree::ExpandAll()
|
||||
{
|
||||
for (const auto ¯o : GetMacros()) {
|
||||
if (!macro->IsGroup()) {
|
||||
continue;
|
||||
}
|
||||
ExpandGroup(macro);
|
||||
}
|
||||
}
|
||||
|
||||
void MacroTree::CollapseAll()
|
||||
{
|
||||
for (const auto ¯o : GetMacros()) {
|
||||
if (!macro->IsGroup()) {
|
||||
continue;
|
||||
}
|
||||
CollapseGroup(macro);
|
||||
}
|
||||
}
|
||||
|
||||
void MacroTree::SelectionChangedHelper(const QItemSelection &,
|
||||
const QItemSelection &)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user