rpcsx/rpcs3/rpcs3qt/flow_widget.h
Megamouse 957713015a screenshot manager: use flow layout
This whole screenshot thing was really janky, as I added it in half a day or so. But this commit should make everything smooth.
Sadly there is no real lazy loading yet (icons are loaded async, but indiscriminately).
2023-04-26 18:07:16 +02:00

32 lines
532 B
C++

#pragma once
#include <QWidget>
class flow_layout;
class flow_widget_item : public QWidget
{
public:
using QWidget::QWidget;
void paintEvent(QPaintEvent* event) override;
bool got_visible{};
std::function<void()> cb_on_first_visibility{};
};
class flow_widget : public QWidget
{
public:
flow_widget(QWidget* parent);
virtual ~flow_widget();
void add_widget(flow_widget_item* widget);
void clear();
QList<flow_widget_item*>& items();
private:
flow_layout* m_flow_layout{};
QList<flow_widget_item*> m_widgets{};
};