mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Highlight primary usernames in profiles like the additional ones.
This commit is contained in:
parent
ab06574fd9
commit
2de76cb75b
1 changed files with 13 additions and 4 deletions
|
@ -372,13 +372,22 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
|
||||||
|
|
||||||
const auto usernameLine = addInfoOneLine(
|
const auto usernameLine = addInfoOneLine(
|
||||||
UsernamesSubtext(_peer, tr::lng_info_username_label()),
|
UsernamesSubtext(_peer, tr::lng_info_username_label()),
|
||||||
UsernameValue(user, true),
|
UsernameValue(user, true) | rpl::map([=](TextWithEntities u) {
|
||||||
tr::lng_context_copy_mention(tr::now),
|
return u.text.isEmpty()
|
||||||
|
? TextWithEntities()
|
||||||
|
: Ui::Text::Link(
|
||||||
|
u,
|
||||||
|
user->session().createInternalLinkFull(
|
||||||
|
u.text.mid(1)));
|
||||||
|
}),
|
||||||
|
QString(),
|
||||||
st::infoProfileLabeledUsernamePadding);
|
st::infoProfileLabeledUsernamePadding);
|
||||||
usernameLine.subtext->overrideLinkClickHandler(UsernamesLinkCallback(
|
const auto callback = UsernamesLinkCallback(
|
||||||
_peer,
|
_peer,
|
||||||
Window::Show(controller),
|
Window::Show(controller),
|
||||||
QString()));
|
QString());
|
||||||
|
usernameLine.text->overrideLinkClickHandler(callback);
|
||||||
|
usernameLine.subtext->overrideLinkClickHandler(callback);
|
||||||
const auto usernameLabel = usernameLine.text;
|
const auto usernameLabel = usernameLine.text;
|
||||||
if (user->isBot()) {
|
if (user->isBot()) {
|
||||||
const auto copyUsername = Ui::CreateChild<Ui::IconButton>(
|
const auto copyUsername = Ui::CreateChild<Ui::IconButton>(
|
||||||
|
|
Loading…
Add table
Reference in a new issue