Allow non-transparent-for-mouse-events toasts.
This commit is contained in:
parent
79af7c5523
commit
a78089716b
4 changed files with 12 additions and 0 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ public:
|
|||
void hideAnimated();
|
||||
void hide();
|
||||
|
||||
void setInputUsed(bool used);
|
||||
[[nodiscard]] not_null<RpWidget*> widget() const;
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ public:
|
|||
|
||||
// shownLevel=1 completely visible, shownLevel=0 completely invisible
|
||||
void setShownLevel(float64 shownLevel);
|
||||
void setInputUsed(bool used);
|
||||
|
||||
void onParentResized();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue