diff --git a/Telegram/Resources/basic.style b/Telegram/Resources/basic.style index 5b1aaae803..76cf5bbf8d 100644 --- a/Telegram/Resources/basic.style +++ b/Telegram/Resources/basic.style @@ -1007,7 +1007,7 @@ msgInvDblCheckImg: sprite(300px, 65px, 20px, 20px); msgInvViewsImg: sprite(104px, 59px, 16px, 11px); msgInvSendingViewsImg: sprite(104px, 114px, 16px, 11px); -msgDateSpace: 19px; +msgDateSpace: 12px; msgDateCheckSpace: 4px; msgDateViewsSpace: 11px; msgDateDelta: point(2px, 5px); diff --git a/Telegram/SourceFiles/core/stl_subset.h b/Telegram/SourceFiles/core/stl_subset.h index 4776148500..10eeadbdf1 100644 --- a/Telegram/SourceFiles/core/stl_subset.h +++ b/Telegram/SourceFiles/core/stl_subset.h @@ -20,6 +20,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once +#include + // we copy some parts of C++11/14/17 std:: library, because on OS X 10.6+ // version we can use C++11/14/17, but we can not use its library :( namespace std_ { @@ -204,11 +206,13 @@ public: } T *release() noexcept { - return getPointerAndReset(_p); + auto old = _p; + _p = nullptr; + return old; } void reset(T *p = nullptr) noexcept { - T *old = _p; + auto old = _p; _p = p; if (old) { delete old; @@ -260,9 +264,12 @@ struct is_base_of { static constexpr bool value = sizeof(check(_host(), int())) == sizeof(_yes); }; -#ifndef OS_MAC_OLD inline void *align(size_t alignment, size_t size, void*& ptr, size_t& space) noexcept { - auto p = reinterpret_cast(ptr); +#ifndef OS_MAC_OLD + using std::uintptr_t; +#endif // OS_MAC_OLD + + auto p = reinterpret_cast(ptr); auto a = (p - 1u + alignment) & -alignment; auto d = a - p; if ((size + d) > space) { @@ -271,6 +278,5 @@ inline void *align(size_t alignment, size_t size, void*& ptr, size_t& space) noe space -= d; return ptr = reinterpret_cast(a); } -#endif // OS_MAC_OLD } // namespace std_ diff --git a/Telegram/SourceFiles/history/history_media_types.cpp b/Telegram/SourceFiles/history/history_media_types.cpp index 35f5114b32..813ff67f13 100644 --- a/Telegram/SourceFiles/history/history_media_types.cpp +++ b/Telegram/SourceFiles/history/history_media_types.cpp @@ -2560,7 +2560,7 @@ int HistoryWebPage::resizeGetHeight(int width) { return _height; } - _width = qMin(width, _maxw); + _width = width = qMin(width, _maxw); width -= st::msgPadding.left() + st::webPageLeft + st::msgPadding.right(); int32 linesMax = 5; @@ -2659,10 +2659,10 @@ void HistoryWebPage::draw(Painter &p, const QRect &r, TextSelection selection, u auto padding = inBubblePadding(); auto tshift = padding.top(); auto bshift = padding.bottom(); + width -= padding.left() + padding.right(); if (_asArticle || (isBubbleBottom() && _attach && _attach->customInfoLayout() && _attach->currentWidth() + _parent->skipBlockWidth() > width + bubble.left() + bubble.right())) { bshift += bottomInfoPadding(); } - width -= padding.left() + padding.right(); QRect bar(rtlrect(st::msgPadding.left(), tshift, st::webPageBar, _height - tshift - bshift, _width)); p.fillRect(bar, barfg); @@ -2994,7 +2994,7 @@ void HistoryGame::initDimensions() { } int HistoryGame::resizeGetHeight(int width) { - _width = qMin(width, _maxw); + _width = width = qMin(width, _maxw); width -= st::msgPadding.left() + st::webPageLeft + st::msgPadding.right(); // enable any count of lines in game description / message @@ -3056,10 +3056,10 @@ void HistoryGame::draw(Painter &p, const QRect &r, TextSelection selection, uint auto padding = inBubblePadding(); auto tshift = padding.top(); auto bshift = padding.bottom(); + width -= padding.left() + padding.right(); if (isBubbleBottom() && _attach && _attach->customInfoLayout() && _attach->currentWidth() + _parent->skipBlockWidth() > width + bubble.left() + bubble.right()) { bshift += bottomInfoPadding(); } - width -= padding.left() + padding.right(); QRect bar(rtlrect(st::msgPadding.left(), tshift, st::webPageBar, _height - tshift - bshift, _width)); p.fillRect(bar, barfg); diff --git a/Telegram/SourceFiles/history/history_message.cpp b/Telegram/SourceFiles/history/history_message.cpp index 88f0ba908b..f47b7e1ff1 100644 --- a/Telegram/SourceFiles/history/history_message.cpp +++ b/Telegram/SourceFiles/history/history_message.cpp @@ -1976,7 +1976,8 @@ bool HistoryService::prepareGameScoreText(const QString &from, QString *outText, auto getGameTitle = [item = gamescore->msg, &second]()->QString { if (auto media = item->getMedia()) { if (media->type() == MediaTypeGame) { - return static_cast(media)->game()->title; + second = MakeShared(item, 0, 0); + return textcmdLink(2, static_cast(media)->game()->title); } } return lang(lng_deleted_message);