share a single ItemIconCache across the UI
This commit is contained in:
@@ -33,11 +33,11 @@ class HeaderBar : public QWidget,
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
// itemsIconDir holds the per-item icon SVGs (REQ-UI-ITEM-ICON); used to show the
|
||||
// building_block icon in the stock display and expand button (REQ-UI-BLOCKS-ICON,
|
||||
// REQ-UI-EXPAND-BUTTON).
|
||||
// itemIcons is the window-wide per-item icon cache (REQ-UI-ITEM-ICON); used to
|
||||
// show the building_block icon in the stock display and expand button
|
||||
// (REQ-UI-BLOCKS-ICON, REQ-UI-EXPAND-BUTTON). Not owned; must outlive this widget.
|
||||
HeaderBar(const Simulation* sim, const GameConfig* config,
|
||||
const std::string& itemsIconDir, QWidget* parent = nullptr);
|
||||
ItemIconCache* itemIcons, QWidget* parent = nullptr);
|
||||
~HeaderBar() override;
|
||||
|
||||
private slots:
|
||||
@@ -73,7 +73,7 @@ private:
|
||||
QPushButton* m_expandButton;
|
||||
std::vector<QPushButton*> m_speedButtons;
|
||||
|
||||
std::unique_ptr<ItemIconCache> m_itemIcons;
|
||||
ItemIconCache* m_itemIcons; // Not owned; lives in MainWindow.
|
||||
|
||||
// The simulation is the single source of truth for the block stock and the
|
||||
// expansion cost; the change events are only refresh signals.
|
||||
|
||||
Reference in New Issue
Block a user