2
0
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:
John Preston
2015-03-25 18:42:15 +03:00
parent 489b151d49
commit 8c7a35c973
18 changed files with 963 additions and 245 deletions

View File

@@ -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;