mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
add users to groups by usernames, copy username from context menu in profile, 0.7.25.dev version
This commit is contained in:
@@ -717,6 +717,9 @@ void ProfileInner::contextMenuEvent(QContextMenuEvent *e) {
|
||||
if (info.contains(mapFromGlobal(e->globalPos()))) {
|
||||
_menu = new ContextMenu(this);
|
||||
_menu->addAction(lang(lng_profile_copy_phone), this, SLOT(onCopyPhone()))->setEnabled(true);
|
||||
if (_peerUser && !_peerUser->username.isEmpty()) {
|
||||
_menu->addAction(lang(lng_context_copy_mention), this, SLOT(onCopyUsername()))->setEnabled(true);
|
||||
}
|
||||
_menu->deleteOnHide();
|
||||
connect(_menu, SIGNAL(destroyed(QObject*)), this, SLOT(onMenuDestroy(QObject*)));
|
||||
_menu->popup(e->globalPos());
|
||||
@@ -735,6 +738,10 @@ void ProfileInner::onCopyPhone() {
|
||||
QApplication::clipboard()->setText(_phoneText);
|
||||
}
|
||||
|
||||
void ProfileInner::onCopyUsername() {
|
||||
QApplication::clipboard()->setText('@' + _peerUser->username);
|
||||
}
|
||||
|
||||
bool ProfileInner::animStep(float64 ms) {
|
||||
float64 dt = ms / st::setPhotoDuration;
|
||||
bool res = true;
|
||||
|
Reference in New Issue
Block a user