diff --git a/src/widgets/helper/splitoverlay.cpp b/src/widgets/helper/splitoverlay.cpp index 1c78a9de2..664177aa3 100644 --- a/src/widgets/helper/splitoverlay.cpp +++ b/src/widgets/helper/splitoverlay.cpp @@ -81,6 +81,8 @@ SplitOverlay::SplitOverlay(Split *parent) up->setIconSize(size); down->setIconSize(size); }); + + this->setMouseTracking(true); } void SplitOverlay::paintEvent(QPaintEvent *event) @@ -122,6 +124,13 @@ void SplitOverlay::resizeEvent(QResizeEvent *event) this->_down->setVisible(highEnough); } +void SplitOverlay::mouseMoveEvent(QMouseEvent *event) +{ + if ((event->modifiers() & Qt::AltModifier) == 0) { + this->hide(); + } +} + SplitOverlay::ButtonEventFilter::ButtonEventFilter(SplitOverlay *_parent, HoveredElement _element) : QObject(_parent) , parent(_parent) diff --git a/src/widgets/helper/splitoverlay.hpp b/src/widgets/helper/splitoverlay.hpp index 4877835ce..f7e8c16dd 100644 --- a/src/widgets/helper/splitoverlay.hpp +++ b/src/widgets/helper/splitoverlay.hpp @@ -19,6 +19,7 @@ public: protected: void paintEvent(QPaintEvent *event) override; void resizeEvent(QResizeEvent *event) override; + void mouseMoveEvent(QMouseEvent *event) override; private: // fourtf: !!! preserve the order of left, up, right and down