Remaining fix of bug Debian BTS #992236 (line distance).
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Wed, 18 Aug 2021 18:23:47 +0000 (20:23 +0200)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Wed, 18 Aug 2021 18:23:47 +0000 (20:23 +0200)
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=992236

src/mvc/delegate.cpp

index 55bf4c88f10831188f2ad67f51e084371550b306..889f87b772ed79efa68b303664911009085045e0 100644 (file)
@@ -88,6 +88,7 @@ void Delegate::paint(QPainter *painter, const QStyleOptionViewItem &option, cons
         fontSmall.setBold(false);
         fontSmall.setPixelSize(aux*0.2);
         QFontMetrics fmSmall(fontSmall);
+
         // font SMALL bold
         QFont fontSmallB = fontSmall;
         fontSmallB.setBold(true);
@@ -151,10 +152,10 @@ void Delegate::paint(QPainter *painter, const QStyleOptionViewItem &option, cons
         Conference& conference = ((Application*) qApp)->activeConference();
         QTime start = conference.shiftTime(event->start().time());
         painter->setFont(fontBig);
-        painter->drawText(titlePointF,start.toString("hh:mm") + "-" + start.addSecs(event->duration()).toString("hh:mm") + ", " + event->roomName());
+        painter->drawText(titlePointF, start.toString("hh:mm") + "-" + start.addSecs(event->duration()).toString("hh:mm") + ", " + event->roomName());
 
         // title
-        titlePointF.setY(titlePointF.y()+fmBig.height()-fmBig.descent());
+        titlePointF.setY(titlePointF.y() + fmBig.lineSpacing());
         painter->setFont(fontBigB);
         QString title = event->title();
         if(fmBigB.boundingRect(title).width() > (option.rect.width()-2*SPACER)) // the title won't fit the screen
@@ -171,17 +172,17 @@ void Delegate::paint(QPainter *painter, const QStyleOptionViewItem &option, cons
             }
             title += "...";
         }
-        painter->drawText(titlePointF,title);
+        painter->drawText(titlePointF, title);
 
         // persons
-        titlePointF.setY(titlePointF.y()+fmSmall.height()-fmSmall.descent());
+        titlePointF.setY(titlePointF.y() + fmBigB.descent() + fmSmall.lineSpacing());
         painter->setFont(fontSmall);
         QString presenterPrefix = event->persons().count() < 2 ? "Presenter" : "Presenters";
-        painter->drawText(titlePointF,presenterPrefix + ": " + event->persons().join(" and "));
+        painter->drawText(titlePointF, presenterPrefix + ": " + event->persons().join(" and "));
 
         // track
-        titlePointF.setY(titlePointF.y()+fmSmall.height()-fmSmall.descent());
-        painter->drawText(titlePointF,"Track: " + Track::retrieveTrackName(event->trackId()));
+        titlePointF.setY(titlePointF.y() + fmSmall.lineSpacing());
+        painter->drawText(titlePointF, "Track: " + Track::retrieveTrackName(event->trackId()));
     }
 
     else // doesn't have parent - time-groups' elements (top items)