app: add editing for "up" field

This commit is contained in:
itsmattkc 2023-08-23 14:34:23 -07:00
parent 5a84afe4b5
commit 8b09d5dba2
2 changed files with 18 additions and 0 deletions

View file

@ -74,6 +74,14 @@ MainWindow::MainWindow(QWidget *parent) :
prow++;
properties_layout->addWidget(new QLabel(tr("Up")), prow, 0);
m_UpEdit = new Vector3Edit();
connect(m_UpEdit, &Vector3Edit::changed, this, &MainWindow::UpChanged);
properties_layout->addWidget(m_UpEdit, prow, 1);
prow++;
properties_layout->addWidget(new QLabel(tr("Start Time")), prow, 0);
start_time_edit_ = new QSpinBox();
@ -142,6 +150,7 @@ void MainWindow::SetPanel(Panel *panel, si::Object *chunk)
if (chunk) {
m_LocationEdit->SetValue(chunk->location_);
m_UpEdit->SetValue(chunk->up_);
start_time_edit_->setValue(chunk->time_offset_);
}
}
@ -332,6 +341,13 @@ void MainWindow::LocationChanged(const Vector3 &v)
}
}
void MainWindow::UpChanged(const si::Vector3 &v)
{
if (last_set_data_) {
last_set_data_->up_ = v;
}
}
void MainWindow::StartTimeChanged(int t)
{
if (last_set_data_) {

View file

@ -56,6 +56,7 @@ private:
QGroupBox *properties_group_;
Vector3Edit *m_LocationEdit;
Vector3Edit *m_UpEdit;
QSpinBox *start_time_edit_;
@ -77,6 +78,7 @@ private slots:
void ViewSIFile();
void LocationChanged(const si::Vector3 &v);
void UpChanged(const si::Vector3 &v);
void StartTimeChanged(int t);
};