GUI: Add header prefix and suffix for formatting

This commit is contained in:
av-dx 2021-07-20 21:09:58 +05:30 committed by Eugene Sandulenko
parent 825709e7ba
commit 4bba4cbee2
2 changed files with 9 additions and 1 deletions

View file

@ -94,6 +94,11 @@ void GroupedListWidget::append(const String &s, ThemeEngine::FontColor color) {
scrollBarRecalc();
}
void GroupedListWidget::setGroupHeaderFormat(const U32String &prefix, const U32String &suffix) {
_groupHeaderPrefix = prefix;
_groupHeaderSuffix = suffix;
}
void GroupedListWidget::groupByAttribute() {
if (_attributeValues.empty()) return;
@ -135,7 +140,7 @@ void GroupedListWidget::sortGroups() {
_listIndex.push_back(kGroupTag - groupID);
displayedHeader.toUppercase();
_list.push_back(displayedHeader);
_list.push_back(_groupHeaderPrefix + displayedHeader + _groupHeaderSuffix);
if (_groupExpanded[groupID]) {
for (int *k = _itemsInGroup[groupID].begin(); k != _itemsInGroup[groupID].end(); ++k) {