Files
hfut-bishe/client/gui/props/CameraPropertySection.h
2026-04-23 13:11:36 +08:00

48 lines
1020 B
C++

#pragma once
#include "props/PropertySectionWidget.h"
#include <QPointF>
#include <QString>
class QCheckBox;
class QDoubleSpinBox;
class QLineEdit;
namespace gui {
class Vec2ParamControl;
}
namespace gui {
struct CameraPropertyUiState {
QString displayName;
QPointF centerWorld;
double viewScale = 1.0;
bool isActivePreviewCamera = false;
};
class CameraPropertySection final : public PropertySectionWidget {
Q_OBJECT
public:
explicit CameraPropertySection(QWidget* parent = nullptr);
void clearDisconnected();
void applyState(const CameraPropertyUiState& s);
void setEditingEnabled(bool on);
signals:
void displayNameCommitted(const QString& text);
void centerEdited(double x, double y);
void viewScaleEdited(double viewScale);
void activePreviewToggled(bool on);
private:
QLineEdit* m_name = nullptr;
Vec2ParamControl* m_center = nullptr;
QDoubleSpinBox* m_viewScale = nullptr;
QCheckBox* m_activePreview = nullptr;
};
} // namespace gui