- highlight goals updated less than 5 minutes ago
[buliscores] / src / src / matchdaymodel.cpp
index 6ed7de7..0fdedf3 100644 (file)
@@ -65,7 +65,7 @@ QVariant MatchDayModel::data(const QModelIndex& index, int role) const
                 break;
             case Match::FirstHalf:
             case Match::SecondHalf:
-                return QIcon(":/bullet-green").pixmap(15,15);
+                return QIcon(":/football").pixmap(15,15);
                 break;
             case Match::HalfTime:
                 return QIcon(":/bullet-yellow").pixmap(15,15);
@@ -134,7 +134,7 @@ QVariant MatchDayModel::data(const QModelIndex& index, int role) const
             s.setWidth(120);
             break;
         case AwayScore:
-            s.setWidth(4);
+            s.setWidth(25);
             break;
         case HomeIcon:
             s.setWidth(29);
@@ -143,7 +143,7 @@ QVariant MatchDayModel::data(const QModelIndex& index, int role) const
             s.setWidth(120);
             break;
         case HomeScore:
-            s.setWidth(4);
+            s.setWidth(25);
             break;
         case Seperator:
             s.setWidth(5);
@@ -168,12 +168,20 @@ QVariant MatchDayModel::data(const QModelIndex& index, int role) const
         }
         break;
 
+    case Qt::ForegroundRole:
+        if ((index.column() == HomeScore &&
+             match->lastHomeGoal().secsTo((QDateTime::currentDateTime())) < 300) ||
+            (index.column() == AwayScore &&
+             match->lastAwayGoal().secsTo((QDateTime::currentDateTime())) < 300)) {
+            return QColor(255, 0, 51);
+        }
+        break;
+
     case Qt::FontRole:
         if ((index.column() == HomeScore ||
-            index.column() == AwayScore) &&
-            (match->lastEvent().secsTo((QDateTime::currentDateTime())) < 300)) {
+             index.column() == AwayScore)) {
             f.setBold(true);
-            f.setPixelSize(16);
+            f.setPixelSize(20);
         } else {
             f.setBold(false);
             f.setPixelSize(14);