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 @@
#include "CountRow.h"
#include <QHBoxLayout>
#include <QLabel>
CountRow::CountRow(const QPixmap& symbol, const QString& name, int count,
QWidget* parent)
: QWidget(parent)
{
QHBoxLayout* layout = new QHBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(6);
m_symbolLabel = new QLabel(this);
m_symbolLabel->setPixmap(symbol);
m_symbolLabel->setVisible(!symbol.isNull());
m_nameLabel = new QLabel(name, this);
// The same "x<count>" notation the recipe tooltip and the header's aggregate count
// use (REQ-UI-MULTI-SELECTION).
m_countLabel = new QLabel(tr("x%1").arg(count), this);
m_countLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
layout->addWidget(m_symbolLabel);
layout->addWidget(m_nameLabel);
layout->addStretch(1);
layout->addWidget(m_countLabel);
}