diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2022-02-19 02:49:58 +0100 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2022-02-19 21:45:43 +0100 |
commit | 46fbb0e74990e1d5909fdef12d8e28da484db7e0 (patch) | |
tree | f0ca8ba06cc015a115b41e95bfa4169cfbea0297 /src/ui/NhekoEventObserver.h | |
parent | Merge pull request #947 from maltee1/search_button (diff) | |
download | nheko-46fbb0e74990e1d5909fdef12d8e28da484db7e0.tar.xz |
Use ListView without scrollview for messages
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
Diffstat (limited to '')
-rw-r--r-- | src/ui/NhekoEventObserver.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/ui/NhekoEventObserver.h b/src/ui/NhekoEventObserver.h new file mode 100644 index 00000000..6d14f30f --- /dev/null +++ b/src/ui/NhekoEventObserver.h @@ -0,0 +1,27 @@ +// 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(); +}; |