give the selection cards their own parts instead of label blobs
This commit is contained in:
28
src/ui/selection/ItemChip.h
Normal file
28
src/ui/selection/ItemChip.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include <QPixmap>
|
||||
#include <QString>
|
||||
#include <QWidget>
|
||||
|
||||
class QLabel;
|
||||
|
||||
// One buffered item: its icon, its count in a larger type, and a sub-line beneath the
|
||||
// count (REQ-UI-SINGLE-SELECTION). Boxed so a row of them reads as separate quantities
|
||||
// rather than as a run of text.
|
||||
class ItemChip : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
// An empty icon leaves the icon off and the chip laid out around the text alone.
|
||||
ItemChip(const QPixmap& icon, QWidget* parent = nullptr);
|
||||
|
||||
void setCount(const QString& count);
|
||||
// Left empty for an item with nothing to say beneath its count.
|
||||
void setSubLine(const QString& subLine);
|
||||
|
||||
private:
|
||||
QLabel* m_iconLabel;
|
||||
QLabel* m_countLabel;
|
||||
QLabel* m_subLineLabel;
|
||||
};
|
||||
Reference in New Issue
Block a user