Slightly improved style of sub-button in sponsored messages.

This commit is contained in:
23rd 2024-04-22 22:47:13 +03:00 committed by John Preston
parent eef65af173
commit b35d3f57fe
2 changed files with 6 additions and 8 deletions

View File

@ -897,12 +897,10 @@ void WebPage::draw(Painter &p, const PaintContext &context) const {
const auto height = st::webPageSponsoredHintFont->height;
const auto radius = height / 2;
_sponsoredData->lastHintPos = QPoint(
_sponsoredData->lastHintPos = QPointF(
radius + inner.left() + _sponsoredData->widthBeforeHint,
tshift
+ (_siteName.style()->font->height - height) / 2
+ st::webPageSponsoredHintFont->descent / 2);
const auto rect = QRect(
tshift + (_siteName.style()->font->height - height) / 2.);
const auto rect = QRectF(
_sponsoredData->lastHintPos,
_sponsoredData->hintSize);
auto hq = PainterHighQualityEnabler(p);
@ -1205,7 +1203,7 @@ TextState WebPage::textState(QPoint point, StateRequest request) const {
result.link = _openl;
}
if (_sponsoredData && _sponsoredData->canReport) {
const auto contains = QRect(
const auto contains = QRectF(
_sponsoredData->lastHintPos,
_sponsoredData->hintSize).contains(point
- QPoint(0, st::msgDateFont->height));
@ -1298,7 +1296,7 @@ void WebPage::clickHandlerPressedChanged(
const auto outer = full - inBubblePadding();
_sponsoredData->hintRipple->add(_lastPoint
+ outer.topLeft()
- _sponsoredData->lastHintPos);
- _sponsoredData->lastHintPos.toPoint());
} else if (_sponsoredData->hintRipple) {
_sponsoredData->hintRipple->lastStop();
}

View File

@ -149,7 +149,7 @@ private:
bool canReport = false;
QSize hintSize;
QPoint lastHintPos;
QPointF lastHintPos;
int widthBeforeHint = 0;
std::unique_ptr<Ui::RippleAnimation> hintRipple;
ClickHandlerPtr hintLink;