]> git.sesse.net Git - pkanalytics/commitdiff
Format events slightly more nicely.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 29 May 2023 13:20:55 +0000 (15:20 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 29 May 2023 13:20:55 +0000 (15:20 +0200)
events.cpp
main.cpp

index 92ca3271188154e13e914642836052cf7592da43..ad70407bdfae7754022551e53ca601fc8e4801c6 100644 (file)
@@ -58,7 +58,30 @@ QVariant EventsModel::data(const QModelIndex &index, int role) const
                        return QVariant();
                }
        } else if (index.column() == 2) {
-               return QString::fromUtf8(events[index.row()].type);
+               string type = e.type;
+               type[0] = toupper(e.type[0]);
+               for (char &ch : type) {
+                       if (ch == '_') {
+                               ch = ' ';
+                       }
+               }
+
+               // Various fixups.
+               if (type == "Pull oob") {
+                       type = "Pull OOB";
+               } else if (type == "Formation defense") {
+                       type = "Defensive formation";
+               } else if (type == "Formation offense") {
+                       type = "Offensive formation";
+               } else if (type == "Set offense") {
+                       type = "On offense";
+               } else if (type == "Set defense") {
+                       type = "On defense";
+               } else if (type == "Catch") {
+                       type = "Catch/take";
+               }
+
+               return QString::fromUtf8(type);
        }
        return QVariant();
 }
index b0488a0304b54e9d9018ce1b6d259dea107952b2..42d42cc0899300aefd254b5f3682e3856f308388 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -47,6 +47,8 @@ MainWindow::MainWindow(EventsModel *events, PlayersModel *players,
        ui->setupUi(this);
 
        ui->event_view->setModel(events);
+       ui->event_view->setColumnWidth(1, 150);
+       ui->event_view->setColumnWidth(2, 150);
        connect(ui->event_view->selectionModel(), &QItemSelectionModel::currentRowChanged,
                [this, events](const QModelIndex &current, const QModelIndex &previous) {
                        uint64_t t = events->get_time(current.row());