initial commit
This commit is contained in:
52
client/gui/props/EntityPropertySection.h
Normal file
52
client/gui/props/EntityPropertySection.h
Normal file
@@ -0,0 +1,52 @@
|
||||
#pragma once
|
||||
|
||||
#include "props/PropertySectionWidget.h"
|
||||
|
||||
#include <QPointF>
|
||||
#include <QString>
|
||||
|
||||
class QLabel;
|
||||
class QLineEdit;
|
||||
class QDoubleSpinBox;
|
||||
|
||||
namespace gui {
|
||||
class Vec2ParamControl;
|
||||
}
|
||||
|
||||
namespace gui {
|
||||
|
||||
struct EntityPropertyUiState {
|
||||
QString displayName;
|
||||
int depthZ = 0;
|
||||
QString distanceScaleText;
|
||||
QPointF pivot;
|
||||
QPointF centroid;
|
||||
double userScale = 1.0;
|
||||
};
|
||||
|
||||
// 实体相关属性(可嵌入 QStackedWidget 的一页)
|
||||
class EntityPropertySection final : public PropertySectionWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit EntityPropertySection(QWidget* parent = nullptr);
|
||||
|
||||
void clearDisconnected();
|
||||
void applyState(const EntityPropertyUiState& s);
|
||||
void setEditingEnabled(bool on);
|
||||
|
||||
signals:
|
||||
void displayNameCommitted(const QString& text);
|
||||
void pivotEdited(double x, double y);
|
||||
void centroidEdited(double x, double y);
|
||||
void userScaleEdited(double value);
|
||||
|
||||
private:
|
||||
QLineEdit* m_name = nullptr;
|
||||
QLabel* m_depth = nullptr;
|
||||
QLabel* m_distScale = nullptr;
|
||||
Vec2ParamControl* m_pivot = nullptr;
|
||||
Vec2ParamControl* m_centroid = nullptr;
|
||||
QDoubleSpinBox* m_userScale = nullptr;
|
||||
};
|
||||
|
||||
} // namespace gui
|
||||
Reference in New Issue
Block a user