diff options
author | ccolin | 2021-01-04 14:04:44 +0100 |
---|---|---|
committer | ccolin | 2021-01-04 14:04:44 +0100 |
commit | d48a05212b6389818993ea8e7cc0f22b7903d4f7 (patch) | |
tree | 4c977cc46eb58012b73643ec5235d15c8694e523 /src/settings_pane.cc | |
parent | 0f06601bc69d08baaa6c5b11c03e59ac818c426e (diff) |
rename CollisionItem to BookmarkItem, change settings pane layout
Diffstat (limited to 'src/settings_pane.cc')
-rw-r--r-- | src/settings_pane.cc | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/settings_pane.cc b/src/settings_pane.cc index 281cd79..76de98f 100644 --- a/src/settings_pane.cc +++ b/src/settings_pane.cc @@ -5,6 +5,7 @@ #include <QFormLayout> #include <QGroupBox> #include <QVBoxLayout> +#include <QTabWidget> SettingsPane::SettingsPane(QWidget *parent) @@ -14,6 +15,7 @@ SettingsPane::SettingsPane(QWidget *parent) QCheckBox *show_trajectories = new QCheckBox(); QCheckBox *show_guides = new QCheckBox(); collisions = new QListWidget(); + speeding_violations = new QListWidget(); connect(sphere_radius, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &SettingsPane::sphereRadiusChanged); @@ -22,28 +24,27 @@ SettingsPane::SettingsPane(QWidget *parent) connect(show_guides, &QCheckBox::stateChanged, this, &SettingsPane::toggledGuides); connect(collisions, &QListWidget::itemClicked, - [&](QListWidgetItem *item) { emit collisionClicked(((CollisionItem *) item)->getFrame()); }); + [&](QListWidgetItem *item) { emit bookmarkClicked(((BookmarkItem *) item)->getFrame()); }); + + QTabWidget *tabs = new QTabWidget(); QFormLayout *layout = new QFormLayout; layout->addRow("Taille de la sphère de collision", sphere_radius); layout->addRow("Afficher les trajectoires", show_trajectories); layout->addRow("Afficher les guides", show_guides); - QGroupBox *box = new QGroupBox(); - box->setTitle("Collisions"); - box->setFlat(true); - box->setAlignment(Qt::AlignHCenter); - QVBoxLayout *box_layout = new QVBoxLayout(); - box_layout->addWidget(collisions); - box->setLayout(box_layout); - layout->addRow(box); + + tabs->addTab(collisions, "Collisions"); + tabs->addTab(speeding_violations, "Excès de vitesse"); + layout->addRow(tabs); + setLayout(layout); } void SettingsPane::addCollision(int idA, int idB, int frame) { - CollisionItem *item = new CollisionItem("Frame " + QString::number(frame) + ": #" - + QString::number(idA) + " et #" + QString::number(idB), - frame); + BookmarkItem *item = new BookmarkItem("Frame " + QString::number(frame) + ": #" + + QString::number(idA) + " et #" + QString::number(idB), + frame); item->setFlags(Qt::ItemIsEnabled | Qt::ItemNeverHasChildren); collisions->addItem(item); } |