Set screen for tooltip

This commit is contained in:
Ilya Fedin 2022-03-20 09:03:23 +04:00 committed by John Preston
parent 39176f619e
commit 89be8d23fc

View file

@ -117,6 +117,7 @@ void Tooltip::popup(const QPoint &m, const QString &text, const style::Tooltip *
// adjust tooltip position
if (screen) {
setScreen(screen);
const auto r = screen->availableGeometry();
if (r.x() + r.width() - _st->skip < p.x() + s.width() && p.x() + s.width() > m.x()) {
p.setX(qMax(r.x() + r.width() - int32(_st->skip) - s.width(), m.x() - s.width()));