give the selection cards their own parts instead of label blobs

This commit is contained in:
2026-08-07 18:43:23 +02:00
parent 2289277e12
commit 075e44d295
54 changed files with 1505 additions and 533 deletions

View File

@@ -5,20 +5,25 @@
#include <QWidget>
struct Building;
class QLabel;
#include "SelectionContext.h"
// The input and output buffer contents of one building (REQ-UI-SINGLE-SELECTION).
struct Building;
class ItemChipRow;
class SectionBox;
// The input and output buffer contents of one building, each a captioned section of item
// chips (REQ-UI-SINGLE-SELECTION).
//
// Counting what is in the buffers is the same for every building type, so it happens
// here; what a cycle consumes and produces is not, so the owning content supplies those
// per-cycle amounts. An item with no entry in the maps is shown without a denominator.
// per-cycle amounts. An item with no entry in the maps is shown without a denominator,
// and a section holding nothing is not shown at all.
class BufferSection : public QWidget
{
Q_OBJECT
public:
explicit BufferSection(QWidget* parent = nullptr);
explicit BufferSection(const SelectionContext& context, QWidget* parent = nullptr);
// perCycleInputs and perCycleOutputs map an item id to the amount one production
// cycle consumes or produces. Both may be empty, for a building that runs no cycle.
@@ -27,5 +32,8 @@ public:
const std::map<std::string, int>& perCycleOutputs);
private:
QLabel* m_label;
SectionBox* m_inputSection;
ItemChipRow* m_inputChips;
SectionBox* m_outputSection;
ItemChipRow* m_outputChips;
};