Fix double click to select full words (#5243)
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -454,7 +454,7 @@ TextElement::TextElement(const QString &text, MessageElementFlags flags,
|
||||
void TextElement::addToContainer(MessageLayoutContainer &container,
|
||||
MessageElementFlags flags)
|
||||
{
|
||||
auto *app = getApp();
|
||||
auto *app = getIApp();
|
||||
|
||||
if (flags.hasAny(this->getFlags()))
|
||||
{
|
||||
@@ -463,6 +463,8 @@ void TextElement::addToContainer(MessageLayoutContainer &container,
|
||||
|
||||
for (const auto &word : this->words_)
|
||||
{
|
||||
auto wordId = container.nextWordId();
|
||||
|
||||
auto getTextLayoutElement = [&](QString text, int width,
|
||||
bool hasTrailingSpace) {
|
||||
auto color = this->color_.getColor(*app->getThemes());
|
||||
@@ -473,6 +475,7 @@ void TextElement::addToContainer(MessageLayoutContainer &container,
|
||||
this->style_, container.getScale());
|
||||
e->setTrailingSpace(hasTrailingSpace);
|
||||
e->setText(text);
|
||||
e->setWordId(wordId);
|
||||
|
||||
return e;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user