Fixes #291 links clickable area
This commit is contained in:
@@ -210,7 +210,7 @@ void MessageLayout::updateBuffer(QPixmap *buffer, int messageIndex, Selection &s
|
||||
QTextOption option;
|
||||
option.setAlignment(Qt::AlignRight | Qt::AlignTop);
|
||||
|
||||
painter.drawText(QRectF(1, 1, this->container.width - 3, 1000),
|
||||
painter.drawText(QRectF(1, 1, this->container.getWidth() - 3, 1000),
|
||||
QString::number(++this->bufferUpdatedCount), option);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -179,6 +179,11 @@ MessageLayoutElement *MessageLayoutContainer::getElementAt(QPoint point)
|
||||
void MessageLayoutContainer::paintElements(QPainter &painter)
|
||||
{
|
||||
for (const std::unique_ptr<MessageLayoutElement> &element : this->elements) {
|
||||
#ifdef OHHEYITSFOURTF
|
||||
painter.setPen(QColor(0, 255, 0));
|
||||
painter.drawRect(element->getRect());
|
||||
#endif
|
||||
|
||||
element->paint(painter);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,8 +186,8 @@ void TextElement::addToContainer(MessageLayoutContainer &container, MessageEleme
|
||||
int charWidth = metrics.width(text[i]);
|
||||
|
||||
if (!container.fitsInLine(width + charWidth)) {
|
||||
container.addElementNoLineBreak(getTextLayoutElement(
|
||||
text.mid(wordStart, i - wordStart), width - lastWidth, false));
|
||||
container.addElementNoLineBreak(
|
||||
getTextLayoutElement(text.mid(wordStart, i - wordStart), width, false));
|
||||
container.breakLine();
|
||||
|
||||
wordStart = i;
|
||||
|
||||
Reference in New Issue
Block a user