增加预览页介绍信息显示
This commit is contained in:
37
client/gui/dialogs/EntityIntroPopup.h
Normal file
37
client/gui/dialogs/EntityIntroPopup.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#pragma once
|
||||
|
||||
#include "core/domain/EntityIntro.h"
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
class QLabel;
|
||||
class QTextEdit;
|
||||
class QVBoxLayout;
|
||||
|
||||
namespace gui {
|
||||
|
||||
/// 预览模式下在实体附近显示的介绍浮层(非模态,可随内容伸缩)
|
||||
class EntityIntroPopup final : public QWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit EntityIntroPopup(QWidget* parent = nullptr);
|
||||
|
||||
void setProjectDir(const QString& absoluteProjectDir);
|
||||
void setContent(const core::EntityIntroContent& content);
|
||||
void showNearCanvasPoint(const QPoint& viewPos, QWidget* canvasWidget);
|
||||
|
||||
void clearAndHide();
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent* e) override;
|
||||
|
||||
private:
|
||||
QString m_projectDirAbs;
|
||||
QLabel* m_title = nullptr;
|
||||
QTextEdit* m_body = nullptr;
|
||||
QWidget* m_imagesHost = nullptr;
|
||||
QVBoxLayout* m_imagesLayout = nullptr;
|
||||
QLabel* m_videoHint = nullptr;
|
||||
};
|
||||
|
||||
} // namespace gui
|
||||
Reference in New Issue
Block a user