fixed the splitoverlay not disappearing when the window is not selected

This commit is contained in:
fourtf 2018-05-17 14:47:23 +02:00
parent 4d3437e6d1
commit c27a4eec33
2 changed files with 10 additions and 0 deletions

View file

@ -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)

View file

@ -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