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();
|
_widget->deleteLater();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Instance::setInputUsed(bool used) {
|
||||||
|
_widget->setInputUsed(used);
|
||||||
|
}
|
||||||
|
|
||||||
not_null<RpWidget*> Instance::widget() const {
|
not_null<RpWidget*> Instance::widget() const {
|
||||||
return _widget.get();
|
return _widget.get();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ public:
|
||||||
void hideAnimated();
|
void hideAnimated();
|
||||||
void hide();
|
void hide();
|
||||||
|
|
||||||
|
void setInputUsed(bool used);
|
||||||
[[nodiscard]] not_null<RpWidget*> widget() const;
|
[[nodiscard]] not_null<RpWidget*> widget() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,12 @@ Widget::Widget(QWidget *parent, const Config &config)
|
||||||
show();
|
show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Widget::setInputUsed(bool used) {
|
||||||
|
setAttribute(
|
||||||
|
Qt::WA_TransparentForMouseEvents,
|
||||||
|
!used && !_text.hasLinks());
|
||||||
|
}
|
||||||
|
|
||||||
void Widget::onParentResized() {
|
void Widget::onParentResized() {
|
||||||
updateGeometry();
|
updateGeometry();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ public:
|
||||||
|
|
||||||
// shownLevel=1 completely visible, shownLevel=0 completely invisible
|
// shownLevel=1 completely visible, shownLevel=0 completely invisible
|
||||||
void setShownLevel(float64 shownLevel);
|
void setShownLevel(float64 shownLevel);
|
||||||
|
void setInputUsed(bool used);
|
||||||
|
|
||||||
void onParentResized();
|
void onParentResized();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue