Fixed display of tooltip for date of stickers.
- Fixed #6426.
 - Regression was introduced in b814c6307a.
			
			
This commit is contained in:
		
							parent
							
								
									405ccb8580
								
							
						
					
					
						commit
						04617e4a12
					
				
					 1 changed files with 11 additions and 4 deletions
				
			
		|  | @ -150,7 +150,7 @@ void UnwrappedMedia::drawSurrounding( | ||||||
| 	const auto rightAction = _parent->displayRightAction(); | 	const auto rightAction = _parent->displayRightAction(); | ||||||
| 	const auto fullRight = calculateFullRight(inner); | 	const auto fullRight = calculateFullRight(inner); | ||||||
| 	auto fullBottom = height(); | 	auto fullBottom = height(); | ||||||
| 	if (rightAction ? true : needInfoDisplay()) { | 	if (needInfoDisplay()) { | ||||||
| 		_parent->drawInfo( | 		_parent->drawInfo( | ||||||
| 			p, | 			p, | ||||||
| 			fullRight, | 			fullRight, | ||||||
|  | @ -217,13 +217,19 @@ PointState UnwrappedMedia::pointState(QPoint point) const { | ||||||
| 		usex = width() - usex - usew; | 		usex = width() - usex - usew; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | 	const auto datey = height() - st::msgDateImgPadding.y() * 2 | ||||||
|  | 		- st::msgDateFont->height; | ||||||
| 	const auto usey = rightAligned ? 0 : (height() - _contentSize.height()); | 	const auto usey = rightAligned ? 0 : (height() - _contentSize.height()); | ||||||
| 	const auto useh = rightAligned | 	const auto useh = rightAligned | ||||||
| 		? std::max( | 		? std::max(_contentSize.height(), datey) | ||||||
| 			_contentSize.height(), |  | ||||||
| 			height() - st::msgDateImgPadding.y() * 2 - st::msgDateFont->height) |  | ||||||
| 		: _contentSize.height(); | 		: _contentSize.height(); | ||||||
| 	const auto inner = QRect(usex, usey, usew, useh); | 	const auto inner = QRect(usex, usey, usew, useh); | ||||||
|  | 
 | ||||||
|  | 	// Rectangle of date bubble.
 | ||||||
|  | 	if (point.x() < calculateFullRight(inner) && point.y() > datey) { | ||||||
|  | 		return PointState::Inside; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	return inner.contains(point) ? PointState::Inside : PointState::Outside; | 	return inner.contains(point) ? PointState::Inside : PointState::Outside; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | @ -358,6 +364,7 @@ QPoint UnwrappedMedia::calculateFastActionPosition( | ||||||
| bool UnwrappedMedia::needInfoDisplay() const { | bool UnwrappedMedia::needInfoDisplay() const { | ||||||
| 	return (_parent->data()->id < 0) | 	return (_parent->data()->id < 0) | ||||||
| 		|| (_parent->isUnderCursor()) | 		|| (_parent->isUnderCursor()) | ||||||
|  | 		|| (_parent->displayRightAction()) | ||||||
| 		|| (_parent->hasOutLayout() | 		|| (_parent->hasOutLayout() | ||||||
| 			&& !Adaptive::ChatWide() | 			&& !Adaptive::ChatWide() | ||||||
| 			&& _content->alwaysShowOutTimestamp()); | 			&& _content->alwaysShowOutTimestamp()); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 23rd
						23rd