2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

preparing new dev version, date tooltip on timestamp hover, year marks in old day labels, new auth code / sms algo

This commit is contained in:
John Preston
2015-08-31 17:27:20 +03:00
parent 84436a34b0
commit d840ec37db
12 changed files with 214 additions and 30 deletions

View File

@@ -559,10 +559,10 @@ void HistoryList::onDragExec() {
QDrag *drag = new QDrag(App::wnd());
QMimeData *mimeData = new QMimeData;
if (dragSticker || dragByDate) {
mimeData->setData(qsl("application/x-td-forward-pressed"), "1");
} else {
if (lnkPhoto || lnkVideo || lnkAudio || lnkDocument || lnkContact) {
mimeData->setData(qsl("application/x-td-forward-pressed-link"), "1");
} else {
mimeData->setData(qsl("application/x-td-forward-pressed"), "1");
}
if (lnkDocument) {
QString already = static_cast<DocumentOpenLink*>(textlnkDown().data())->document()->already(true);
@@ -1346,7 +1346,6 @@ void HistoryList::onUpdateSelected() {
if (_dragItem && _dragItem->detached()) {
dragActionCancel();
}
linkTipTimer.start(1000);
Qt::CursorShape cur = style::cur_default;
HistoryCursorState cursorState = HistoryDefaultCursorState;
@@ -1383,6 +1382,12 @@ void HistoryList::onUpdateSelected() {
}
}
}
if (lnk || cursorState == HistoryInDateCursorState) {
linkTipTimer.start(1000);
}
if (_dragCursorState == HistoryInDateCursorState && cursorState != HistoryInDateCursorState) {
QToolTip::showText(_dragPos, QString(), App::wnd());
}
if (_dragAction == NoDrag) {
_dragCursorState = cursorState;
@@ -1546,6 +1551,10 @@ void HistoryList::showLinkTip() {
TextLinkPtr lnk = textlnkOver();
if (lnk && !lnk->fullDisplayed()) {
QToolTip::showText(_dragPos, lnk->readable(), App::wnd());
} else if (_dragCursorState == HistoryInDateCursorState && _dragAction == NoDrag) {
if (App::hoveredItem()) {
QToolTip::showText(_dragPos, App::hoveredItem()->date.toString(QLocale::system().dateTimeFormat(QLocale::LongFormat)), App::wnd());
}
}
}
@@ -3416,7 +3425,7 @@ void HistoryWidget::shareContact(const PeerId &peer, const QString &phone, const
fastShowAtEnd(h);
PeerData *p = App::peer(peer);
int32 flags = newMessageFlags(p); // unread, out
int32 flags = newMessageFlags(p) | MTPDmessage::flag_media; // unread, out
bool lastKeyboardUsed = lastForceReplyReplied(replyTo);
@@ -4296,14 +4305,15 @@ void HistoryWidget::confirmSendImage(const ReadyLocalMedia &img) {
fastShowAtEnd(h);
int32 flags = newMessageFlags(h->peer); // unread, out
int32 flags = newMessageFlags(h->peer) | MTPDmessage::flag_media; // unread, out
if (img.replyTo) flags |= MTPDmessage::flag_reply_to_msg_id;
if (img.type == ToPreparePhoto) {
h->addToBack(MTP_message(MTP_int(flags), MTP_int(newId), MTP_int(MTP::authedId()), App::peerToMTP(img.peer), MTPint(), MTPint(), MTP_int(img.replyTo), MTP_int(unixtime()), MTP_string(""), MTP_messageMediaPhoto(img.photo, MTP_string("")), MTPnullMarkup, MTPnullEntities));
} else if (img.type == ToPrepareDocument) {
h->addToBack(MTP_message(MTP_int(flags), MTP_int(newId), MTP_int(MTP::authedId()), App::peerToMTP(img.peer), MTPint(), MTPint(), MTP_int(img.replyTo), MTP_int(unixtime()), MTP_string(""), MTP_messageMediaDocument(img.document), MTPnullMarkup, MTPnullEntities));
} else if (img.type == ToPrepareAudio) {
h->addToBack(MTP_message(MTP_int(flags | MTPDmessage_flag_media_unread), MTP_int(newId), MTP_int(MTP::authedId()), App::peerToMTP(img.peer), MTPint(), MTPint(), MTP_int(img.replyTo), MTP_int(unixtime()), MTP_string(""), MTP_messageMediaAudio(img.audio), MTPnullMarkup, MTPnullEntities));
flags |= MTPDmessage_flag_media_unread;
h->addToBack(MTP_message(MTP_int(flags), MTP_int(newId), MTP_int(MTP::authedId()), App::peerToMTP(img.peer), MTPint(), MTPint(), MTP_int(img.replyTo), MTP_int(unixtime()), MTP_string(""), MTP_messageMediaAudio(img.audio), MTPnullMarkup, MTPnullEntities));
}
if (_peer && img.peer == _peer->id) {
@@ -4902,7 +4912,7 @@ void HistoryWidget::onStickerSend(DocumentData *sticker) {
bool lastKeyboardUsed = lastForceReplyReplied();
bool out = (_peer->input.type() != mtpc_inputPeerSelf), unread = (_peer->input.type() != mtpc_inputPeerSelf);
int32 flags = newMessageFlags(_peer); // unread, out
int32 flags = newMessageFlags(_peer) | MTPDmessage::flag_media; // unread, out
int32 sendFlags = 0;
if (replyToId()) {
flags |= MTPDmessage::flag_reply_to_msg_id;