Allow non-transparent-for-mouse-events toasts.

This commit is contained in:
John Preston 2022-05-26 12:30:14 +04:00
parent 79af7c5523
commit a78089716b
4 changed files with 12 additions and 0 deletions

View file

@ -87,6 +87,10 @@ void Instance::hide() {
_widget->deleteLater();
}
void Instance::setInputUsed(bool used) {
_widget->setInputUsed(used);
}
not_null<RpWidget*> Instance::widget() const {
return _widget.get();
}

View file

@ -56,6 +56,7 @@ public:
void hideAnimated();
void hide();
void setInputUsed(bool used);
[[nodiscard]] not_null<RpWidget*> widget() const;
private:

View file

@ -49,6 +49,12 @@ Widget::Widget(QWidget *parent, const Config &config)
show();
}
void Widget::setInputUsed(bool used) {
setAttribute(
Qt::WA_TransparentForMouseEvents,
!used && !_text.hasLinks());
}
void Widget::onParentResized() {
updateGeometry();
}

View file

@ -21,6 +21,7 @@ public:
// shownLevel=1 completely visible, shownLevel=0 completely invisible
void setShownLevel(float64 shownLevel);
void setInputUsed(bool used);
void onParentResized();