add border around recipes where several of them stack

This commit is contained in:
2026-08-12 08:30:10 +02:00
parent a3fddf63cc
commit bd8fe5157e
5 changed files with 49 additions and 9 deletions

View File

@@ -12,6 +12,7 @@
class BuildingIconCache;
class ItemIconCache;
class QHBoxLayout;
class QVBoxLayout;
// One recipe drawn: what it consumes, an arrow, what it produces, and how long a cycle
// takes (REQ-UI-RECIPE-SUMMARY), under a header naming the building that runs it and the
@@ -87,12 +88,20 @@ public:
// recipe shows no summary at all (REQ-UI-RECIPE-SUMMARY).
void setLine(const Spec& spec);
// Boxes the line in a card of its own, for the two places that stack several of them
// (REQ-UI-ITEM-TOOLTIP, REQ-DEF-SCHEMATIC-DROP): a run of bare lines reads as one
// field of icons and numbers, and the box is what separates one recipe from the next.
// Off by default -- a line drawn inside a button or a panel section is already framed
// by what holds it.
void setCardChrome(bool enabled);
private:
void rebuild(const Spec& spec);
void addAmounts(const std::vector<Amount>& amounts);
ItemIconCache* m_itemIcons;
BuildingIconCache* m_buildingIcons;
QVBoxLayout* m_outerLayout;
// The two lines, each a row widget of its own so a rebuild only has to empty their
// layouts -- no nested layout to take apart. The header is hidden where the spec
// names neither a building nor a recipe.