Resize list to minimum necessary height

This commit is contained in:
WarmUpTill
2021-11-21 15:08:10 +01:00
committed by WarmUpTill
parent 5dfed8ac2a
commit 4d32e921f9
6 changed files with 34 additions and 0 deletions

View File

@@ -137,6 +137,7 @@ void MacroActionRunEdit::UpdateEntryData()
QListWidgetItem *item = new QListWidgetItem(arg, _argList);
item->setData(Qt::UserRole, arg);
}
SetArgListSize();
}
void MacroActionRunEdit::PathChanged(const QString &text)
@@ -175,6 +176,7 @@ void MacroActionRunEdit::AddArg()
std::lock_guard<std::mutex> lock(switcher->m);
_entryData->_args << arg;
SetArgListSize();
}
void MacroActionRunEdit::RemoveArg()
@@ -195,6 +197,7 @@ void MacroActionRunEdit::RemoveArg()
return;
}
delete item;
SetArgListSize();
}
void MacroActionRunEdit::ArgUp()
@@ -224,3 +227,9 @@ void MacroActionRunEdit::ArgDown()
_entryData->_args.move(idx, idx + 1);
}
}
void MacroActionRunEdit::SetArgListSize()
{
setHeightToContentHeight(_argList);
adjustSize();
}