That way we can autohide the scollbar if needed, it should fix some jumping issues, it makes it possible to flick on mobile, etc. Some related bugs: https://bugreports.qt.io/browse/QTBUG-75223 https://bugreports.qt.io/browse/QTBUG-44902
28 lines
542 B
C++
28 lines
542 B
C++
// SPDX-FileCopyrightText: 2022 Nheko Contributors
|
|
//
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include <QQuickItem>
|
|
|
|
class NhekoEventObserver : public QQuickItem
|
|
{
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY(bool wasTouched READ wasTouched NOTIFY wasTouchedChanged)
|
|
|
|
public:
|
|
explicit NhekoEventObserver(QQuickItem *parent = 0);
|
|
|
|
bool childMouseEventFilter(QQuickItem *item, QEvent *event) override;
|
|
|
|
private:
|
|
bool wasTouched() { return wasTouched_; }
|
|
|
|
bool wasTouched_ = false;
|
|
|
|
signals:
|
|
void wasTouchedChanged();
|
|
};
|