Fix panel mouse event handling

This commit is contained in:
lupoDharkael
2018-04-15 12:59:07 +02:00
parent 522c9b1ed1
commit 7b36148c05

View File

@@ -30,6 +30,7 @@
UtilityPanel::UtilityPanel(QWidget *parent) : QWidget(parent) {
initInternalPanel();
setAttribute(Qt::WA_TransparentForMouseEvents);
m_showAnimation = new QPropertyAnimation(m_internalPanel, "geometry", this);
m_showAnimation->setEasingCurve(QEasingCurve::InOutQuad);
@@ -57,11 +58,13 @@ void UtilityPanel::pushWidget(QWidget *w) {
void UtilityPanel::toggle() {
if (m_internalPanel->isHidden()) {
setAttribute(Qt::WA_TransparentForMouseEvents, false);
m_showAnimation->setStartValue(QRect(-width(), 0, 0, height()));
m_showAnimation->setEndValue(QRect(0, 0, width(), height()));
m_internalPanel->show();
m_showAnimation->start();
} else {
setAttribute(Qt::WA_TransparentForMouseEvents);
m_hideAnimation->setStartValue(QRect(0, 0, width(), height()));
m_hideAnimation->setEndValue(QRect(-width(), 0, 0, height()));
m_hideAnimation->start();