state the debris scrap value with the item icon, not the word

This commit is contained in:
2026-08-12 21:21:47 +02:00
parent 28656bea7e
commit 7e670fc01c
12 changed files with 126 additions and 19 deletions

View File

@@ -3,6 +3,8 @@
#include <QVBoxLayout>
#include "DebrisScrap.h"
#include "IconCaption.h"
#include "ItemIconCache.h"
#include "Simulation.h"
#include "StatRow.h"
@@ -10,8 +12,16 @@ DebrisContent::DebrisContent(const SelectionContext& context,
const SelectionRequest& request, QWidget* parent)
: SelectionContent(context, std::nullopt, parent)
, m_debris(request.debris)
, m_scrapIcon(context.itemIcons->getInlineIcon(kScrapItemId, font()))
{
m_scrapRow = new StatRow(tr("Scrap remaining"), this);
// The row states the amount and the bare scrap icon, the icon standing in for the
// word so the row spells out neither the item nor its unit -- the form the header bar
// states the block stock in (REQ-UI-DEBRIS-PANEL, REQ-UI-ITEM-ICON,
// REQ-UI-BLOCKS-ICON). Without an icon file the caption has to name the item again,
// since nothing else on the row would.
m_scrapRow = new StatRow(
m_scrapIcon.isNull() ? tr("Scrap remaining") : tr("Remaining"), this);
m_scrapRow->setValueIcon(m_scrapIcon);
m_scrapRow->setValueEmphasized(true);
getRuntimeLayout()->addWidget(m_scrapRow);