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

@@ -0,0 +1,29 @@
#pragma once
#include <QColor>
#include <QString>
#include <QWidget>
class QLabel;
// The card header's right slot (REQ-UI-SELECTION-CARD): a colored dot with a short
// caption beside it. It carries a building's production status
// (REQ-UI-SELECTION-STATUS), a ship's current behavior (REQ-UI-SHIP-BEHAVIOR), or an
// aggregated selection's object count (REQ-UI-SELECTION-AGGREGATE) -- never more than
// one of them, which is why they share one part.
class StatusPill : public QWidget
{
Q_OBJECT
public:
explicit StatusPill(QWidget* parent = nullptr);
// An invalid dot color leaves the dot off, for the slots that are a plain caption.
// An empty caption hides the pill entirely.
void setStatus(const QColor& dotColor, const QColor& outlineColor,
const QString& caption);
private:
QLabel* m_dotLabel;
QLabel* m_captionLabel;
};