2018-10-02 04:59:30 +00:00
|
|
|
#ifndef MOTION_WIDGET_H
|
|
|
|
#define MOTION_WIDGET_H
|
|
|
|
#include <QFrame>
|
|
|
|
#include <QLabel>
|
|
|
|
#include <QIcon>
|
|
|
|
#include "skeletondocument.h"
|
2018-10-23 14:57:47 +00:00
|
|
|
#include "modelwidget.h"
|
2018-10-02 04:59:30 +00:00
|
|
|
|
|
|
|
class MotionWidget : public QFrame
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
signals:
|
|
|
|
void modifyMotion(QUuid motionId);
|
2018-10-23 14:57:47 +00:00
|
|
|
void cornerButtonClicked(QUuid motionId);
|
2018-10-02 04:59:30 +00:00
|
|
|
public:
|
|
|
|
MotionWidget(const SkeletonDocument *document, QUuid motionId);
|
|
|
|
static int preferredHeight();
|
2018-10-23 14:57:47 +00:00
|
|
|
ModelWidget *previewWidget();
|
2018-10-02 04:59:30 +00:00
|
|
|
protected:
|
|
|
|
void mouseDoubleClickEvent(QMouseEvent *event) override;
|
|
|
|
void resizeEvent(QResizeEvent *event) override;
|
|
|
|
public slots:
|
|
|
|
void reload();
|
|
|
|
void updatePreview();
|
|
|
|
void updateName();
|
|
|
|
void updateCheckedState(bool checked);
|
2018-10-23 14:57:47 +00:00
|
|
|
void setCornerButtonVisible(bool visible);
|
2018-10-02 04:59:30 +00:00
|
|
|
private:
|
|
|
|
QUuid m_motionId;
|
|
|
|
const SkeletonDocument *m_document = nullptr;
|
2018-10-23 14:57:47 +00:00
|
|
|
ModelWidget *m_previewWidget = nullptr;
|
2018-10-02 04:59:30 +00:00
|
|
|
QLabel *m_nameLabel = nullptr;
|
2018-10-23 14:57:47 +00:00
|
|
|
QPushButton *m_cornerButton = nullptr;
|
2018-10-02 04:59:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|