From 175e0f71ce877135bedb5f319fabdf3a3fdcbc14 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 13 Apr 2015 09:58:13 +0100 Subject: [PATCH] fixed reply to text color --- Telegram/SourceFiles/history.cpp | 3 ++- Telegram/SourceFiles/history.h | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 0f24e7460..beefcf3c6 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -5094,8 +5094,9 @@ void HistoryReply::drawReplyTo(QPainter &p, int32 x, int32 y, int32 w, bool sele } replyToName.drawElided(p, x + st::msgReplyBarSkip + previewSkip, y + st::msgReplyPadding.top(), w - st::msgReplyBarSkip - previewSkip); + HistoryMessage *replyToAsMsg = replyToMsg->toHistoryMessage(); if (likeService) { - } else if (replyToMsg->getMedia() || replyToMsg->serviceMsg()) { + } else if ((replyToAsMsg && replyToAsMsg->justMedia()) || replyToMsg->serviceMsg()) { style::color date(selected ? (out() ? st::msgOutSelectDateColor : st::msgInSelectDateColor) : (out() ? st::msgOutDateColor : st::msgInDateColor)); p.setPen(date->p); } else { diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index 642a53c4b..4897eadcf 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -620,6 +620,7 @@ private: ItemAnimations &itemAnimations(); class HistoryReply; // dynamic_cast optimize +class HistoryMessage; // dynamic_cast optimize class HistoryMedia; class HistoryItem : public HistoryElem { @@ -735,6 +736,12 @@ public: virtual const HistoryReply *toHistoryReply() const { // dynamic_cast optimize return 0; } + virtual HistoryMessage *toHistoryMessage() { // dynamic_cast optimize + return 0; + } + virtual const HistoryMessage *toHistoryMessage() const { // dynamic_cast optimize + return 0; + } virtual ~HistoryItem(); @@ -1236,6 +1243,13 @@ public: return from(); } + HistoryMessage *toHistoryMessage() { // dynamic_cast optimize + return this; + } + const HistoryMessage *toHistoryMessage() const { // dynamic_cast optimize + return this; + } + ~HistoryMessage(); protected: