|
|
@ -134,6 +134,10 @@ QWidget * MainWindow::buildAddUI() { |
|
|
|
auto normalizeLengthsBtn = new QPushButton("Normalize"); |
|
|
|
auto normalizeLengthsBtn = new QPushButton("Normalize"); |
|
|
|
auto resetLengthsBtn = new QPushButton("Reset"); |
|
|
|
auto resetLengthsBtn = new QPushButton("Reset"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
resetMassesBtn->setIcon(QIcon(":/icons/refresh.svg")); |
|
|
|
|
|
|
|
normalizeLengthsBtn->setIcon(QIcon(":/icons/compress.svg")); |
|
|
|
|
|
|
|
resetLengthsBtn->setIcon(QIcon(":/icons/refresh.svg")); |
|
|
|
|
|
|
|
|
|
|
|
connect(resetMassesBtn, &QPushButton::clicked, this, &MainWindow::resetMasses); |
|
|
|
connect(resetMassesBtn, &QPushButton::clicked, this, &MainWindow::resetMasses); |
|
|
|
connect(normalizeLengthsBtn, &QPushButton::clicked, this, &MainWindow::normalizeLengths); |
|
|
|
connect(normalizeLengthsBtn, &QPushButton::clicked, this, &MainWindow::normalizeLengths); |
|
|
|
connect(resetLengthsBtn, &QPushButton::clicked, this, &MainWindow::resetLengths); |
|
|
|
connect(resetLengthsBtn, &QPushButton::clicked, this, &MainWindow::resetLengths); |
|
|
@ -278,7 +282,9 @@ QWidget * MainWindow::buildAddUI() { |
|
|
|
lyt->addLayout(btnLyt); |
|
|
|
lyt->addLayout(btnLyt); |
|
|
|
|
|
|
|
|
|
|
|
auto addBtn = new QPushButton("Add"); |
|
|
|
auto addBtn = new QPushButton("Add"); |
|
|
|
auto removeBtn = new QPushButton("Remove"); |
|
|
|
auto removeBtn = new QPushButton("Remove all"); |
|
|
|
|
|
|
|
addBtn->setIcon(QIcon(":/icons/add.svg")); |
|
|
|
|
|
|
|
removeBtn->setIcon(QIcon(":/icons/delete.svg")); |
|
|
|
|
|
|
|
|
|
|
|
connect(addBtn, &QPushButton::clicked, this, &MainWindow::add); |
|
|
|
connect(addBtn, &QPushButton::clicked, this, &MainWindow::add); |
|
|
|
connect(removeBtn, &QPushButton::clicked, this, &MainWindow::remove); |
|
|
|
connect(removeBtn, &QPushButton::clicked, this, &MainWindow::remove); |
|
|
@ -330,10 +336,13 @@ QWidget * MainWindow::buildSimulationUI() { |
|
|
|
|
|
|
|
|
|
|
|
auto reset = new QPushButton("Reset"); |
|
|
|
auto reset = new QPushButton("Reset"); |
|
|
|
auto togglePlay = new QPushButton("Resume"); |
|
|
|
auto togglePlay = new QPushButton("Resume"); |
|
|
|
|
|
|
|
reset->setIcon(QIcon(":/icons/refresh.svg")); |
|
|
|
|
|
|
|
togglePlay->setIcon(QIcon(":/icons/play.svg")); |
|
|
|
|
|
|
|
|
|
|
|
connect(reset, &QPushButton::clicked, this, &MainWindow::resetSimulationControl); |
|
|
|
connect(reset, &QPushButton::clicked, this, &MainWindow::resetSimulationControl); |
|
|
|
connect(togglePlay, &QPushButton::clicked, this, &MainWindow::toggleSimulation); |
|
|
|
connect(togglePlay, &QPushButton::clicked, this, &MainWindow::toggleSimulation); |
|
|
|
connect(togglePlay, &QPushButton::clicked, [this, togglePlay](){ |
|
|
|
connect(togglePlay, &QPushButton::clicked, [this, togglePlay](){ |
|
|
|
|
|
|
|
togglePlay->setIcon(QIcon(QString(":/icons/") + (simulation->isPlaying ? "pause.svg" : "play.svg"))); |
|
|
|
togglePlay->setText(simulation->isPlaying ? "Pause" : "Resume"); |
|
|
|
togglePlay->setText(simulation->isPlaying ? "Pause" : "Resume"); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|