GUI: Add header prefix and suffix for formatting
This commit is contained in:
parent
825709e7ba
commit
4bba4cbee2
2 changed files with 9 additions and 1 deletions
|
@ -94,6 +94,11 @@ void GroupedListWidget::append(const String &s, ThemeEngine::FontColor color) {
|
||||||
scrollBarRecalc();
|
scrollBarRecalc();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GroupedListWidget::setGroupHeaderFormat(const U32String &prefix, const U32String &suffix) {
|
||||||
|
_groupHeaderPrefix = prefix;
|
||||||
|
_groupHeaderSuffix = suffix;
|
||||||
|
}
|
||||||
|
|
||||||
void GroupedListWidget::groupByAttribute() {
|
void GroupedListWidget::groupByAttribute() {
|
||||||
if (_attributeValues.empty()) return;
|
if (_attributeValues.empty()) return;
|
||||||
|
|
||||||
|
@ -135,7 +140,7 @@ void GroupedListWidget::sortGroups() {
|
||||||
_listIndex.push_back(kGroupTag - groupID);
|
_listIndex.push_back(kGroupTag - groupID);
|
||||||
|
|
||||||
displayedHeader.toUppercase();
|
displayedHeader.toUppercase();
|
||||||
_list.push_back(displayedHeader);
|
_list.push_back(_groupHeaderPrefix + displayedHeader + _groupHeaderSuffix);
|
||||||
|
|
||||||
if (_groupExpanded[groupID]) {
|
if (_groupExpanded[groupID]) {
|
||||||
for (int *k = _itemsInGroup[groupID].begin(); k != _itemsInGroup[groupID].end(); ++k) {
|
for (int *k = _itemsInGroup[groupID].begin(); k != _itemsInGroup[groupID].end(); ++k) {
|
||||||
|
|
|
@ -39,6 +39,8 @@ protected:
|
||||||
String _groupingAttribute;
|
String _groupingAttribute;
|
||||||
Common::HashMap<U32String, int> _groupValueIndex;
|
Common::HashMap<U32String, int> _groupValueIndex;
|
||||||
Common::Array<bool> _groupExpanded;
|
Common::Array<bool> _groupExpanded;
|
||||||
|
U32String _groupHeaderPrefix;
|
||||||
|
U32String _groupHeaderSuffix;
|
||||||
U32StringArray _groupHeaders;
|
U32StringArray _groupHeaders;
|
||||||
U32StringArray _attributeValues;
|
U32StringArray _attributeValues;
|
||||||
Common::HashMap<int, Common::Array<int>> _itemsInGroup;
|
Common::HashMap<int, Common::Array<int>> _itemsInGroup;
|
||||||
|
@ -51,6 +53,7 @@ public:
|
||||||
const U32StringArray &getList() const { return _dataList; }
|
const U32StringArray &getList() const { return _dataList; }
|
||||||
|
|
||||||
void append(const String &s, ThemeEngine::FontColor color = ThemeEngine::kFontColorNormal);
|
void append(const String &s, ThemeEngine::FontColor color = ThemeEngine::kFontColorNormal);
|
||||||
|
void setGroupHeaderFormat(const U32String &prefix, const U32String &suffix);
|
||||||
void groupByAttribute();
|
void groupByAttribute();
|
||||||
|
|
||||||
void setSelected(int item);
|
void setSelected(int item);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue