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

Fix some stories tooltip edge cases.

This commit is contained in:
John Preston
2023-07-25 10:45:08 +04:00
parent 065eb8e63c
commit 57fc9f71ac
3 changed files with 9 additions and 9 deletions

View File

@@ -951,9 +951,6 @@ void List::updateTooltipGeometry() {
return;
}
const auto collapsed = collapsedGeometryCurrent();
if (collapsed.geometry.isEmpty()) {
int a = 0;
}
const auto geometry = Ui::MapFrom(
window(),
parentWidget(),
@@ -964,8 +961,12 @@ void List::updateTooltipGeometry() {
collapsed.geometry.height()));
const auto weak = QPointer<QWidget>(_tooltip.get());
const auto countPosition = [=](QSize size) {
const auto left = geometry.x()
+ (geometry.width() - size.width()) / 2;
const auto right = window()->width()
- st::dialogsStoriesTooltip.padding.right();
return QPoint(
geometry.x() + (geometry.width() - size.width()) / 2,
std::max(std::min(left, right - size.width()), 0),
geometry.y() + geometry.height());
};
_tooltip->pointAt(geometry, RectPart::Bottom, countPosition);