forked from qt-creator/qt-creator
Examples: Fix which category gets two columns
It was giving the first category _alphabetically_ two columns. Which was correct a while ago, but since we have a separate category order defined, it should give the first category in that order two columns instead. Fixes: QTCREATORBUG-30634 Change-Id: Ie89c84f31617a9f90fe18b66bcea352ae3ea56d5 Reviewed-by: Kai Köhne <kai.koehne@qt.io>
This commit is contained in:
@@ -373,8 +373,8 @@ QList<std::pair<Core::Section, QList<ExampleItem *>>> getCategories(const QList<
|
||||
// order "known" categories as wanted, others come afterwards
|
||||
const int defaultIndex = defaultOrder.indexOf(it->first);
|
||||
const int priority = defaultIndex >= 0 ? defaultIndex : (index + defaultOrderSize);
|
||||
const std::optional<int> maxRows = restrictRows
|
||||
? std::make_optional<int>(index == 0 ? 2 : 1)
|
||||
const std::optional<int> maxRows = restrictRows ? std::make_optional<int>(
|
||||
defaultIndex == 0 ? 2 : 1)
|
||||
: std::nullopt;
|
||||
categories.append({{it->first, priority, maxRows}, it->second});
|
||||
++index;
|
||||
|
Reference in New Issue
Block a user