#ifndef RENDER_WND_RESOURCE_H
#define RENDER_WND_RESOURCE_H
#include <QWidget>
#include <list>
#include <filesystem>

#include "states.h"


class QLabel;
class QScrollArea;
class ListItemWidget;
class QStackedWidget;
class WndResource : public QWidget {
    Q_OBJECT

public:
    enum struct Mode {
        None = 0, Model = 1, Material = 2, Texture = 3, Shader = 4
    };
    struct Res {
        std::filesystem::path path;
        void *data;
    };
    explicit WndResource(QWidget *parent);

private:

    void SelectMode(Mode mode);

    void ShowModel();
    void ShowMat();
    void ShowTex();
    void ShowShader();

    void UnselectAllItem();
    void OnBtnLoadResource();
    void InitPanel(QScrollArea *scroll, const std::list<Res> &list, const char *type);

private:
    Mode m_Mode{Mode::None};

    QStackedWidget *m_stack{};

    QScrollArea *m_model{};
    QScrollArea *m_material{};
    QScrollArea *m_texture{};
    QScrollArea *m_shader{};
    std::list<Res> m_lstModel{};
    std::list<Res> m_lstMaterial;
    std::list<Res> m_lstTexture{};
    std::list<Res> m_lstShader{};


    ListItemWidget *m_selectedItem{};
};













#endif //RENDER_WND_RESOURCE_H
