Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
feat(UI): make it possible to select text of the received friend request
Browse files Browse the repository at this point in the history
  • Loading branch information
zetok committed Dec 9, 2016
1 parent 9d1275b commit 0660695
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/widget/form/addfriendform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,14 @@ void AddFriendForm::addFriendRequestWidget(const QString &friendAddress, const Q
friendLayout->addLayout(horLayout);

CroppingLabel* friendLabel = new CroppingLabel(friendWidget);
friendLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
friendLabel->setText("<b>" + friendAddress + "</b>");
horLayout->addWidget(friendLabel);

QLabel* messageLabel = new QLabel(message);
// allow to select text, but treat links as plaintext to prevent phishing
messageLabel->setTextInteractionFlags(Qt::TextSelectableByMouse |
Qt::TextSelectableByKeyboard);
messageLabel->setTextFormat(Qt::PlainText);
messageLabel->setWordWrap(true);
horLayout->addWidget(messageLabel, 1);
Expand Down

0 comments on commit 0660695

Please sign in to comment.