mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Fixes #291 links clickable area
This commit is contained in:
parent
93163518cc
commit
93f9996207
|
@ -210,7 +210,7 @@ void MessageLayout::updateBuffer(QPixmap *buffer, int messageIndex, Selection &s
|
||||||
QTextOption option;
|
QTextOption option;
|
||||||
option.setAlignment(Qt::AlignRight | Qt::AlignTop);
|
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);
|
QString::number(++this->bufferUpdatedCount), option);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -179,6 +179,11 @@ MessageLayoutElement *MessageLayoutContainer::getElementAt(QPoint point)
|
||||||
void MessageLayoutContainer::paintElements(QPainter &painter)
|
void MessageLayoutContainer::paintElements(QPainter &painter)
|
||||||
{
|
{
|
||||||
for (const std::unique_ptr<MessageLayoutElement> &element : this->elements) {
|
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);
|
element->paint(painter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -186,8 +186,8 @@ void TextElement::addToContainer(MessageLayoutContainer &container, MessageEleme
|
||||||
int charWidth = metrics.width(text[i]);
|
int charWidth = metrics.width(text[i]);
|
||||||
|
|
||||||
if (!container.fitsInLine(width + charWidth)) {
|
if (!container.fitsInLine(width + charWidth)) {
|
||||||
container.addElementNoLineBreak(getTextLayoutElement(
|
container.addElementNoLineBreak(
|
||||||
text.mid(wordStart, i - wordStart), width - lastWidth, false));
|
getTextLayoutElement(text.mid(wordStart, i - wordStart), width, false));
|
||||||
container.breakLine();
|
container.breakLine();
|
||||||
|
|
||||||
wordStart = i;
|
wordStart = i;
|
||||||
|
|
Loading…
Reference in a new issue