mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 22:54:01 +02:00
Simplified proper cleanup of allocated event filters for swipe handler.
This commit is contained in:
parent
d49da1fdd0
commit
667e614bf3
1 changed files with 3 additions and 3 deletions
|
@ -76,7 +76,7 @@ void SetupSwipeHandler(SwipeHandlerArgs &&args) {
|
||||||
bool touch = false;
|
bool touch = false;
|
||||||
};
|
};
|
||||||
struct State {
|
struct State {
|
||||||
base::unique_qptr<QObject> filterContext;
|
base::unique_qptr<QObject> filter;
|
||||||
Ui::Animations::Simple animationReach;
|
Ui::Animations::Simple animationReach;
|
||||||
Ui::Animations::Simple animationEnd;
|
Ui::Animations::Simple animationEnd;
|
||||||
SwipeContextData data;
|
SwipeContextData data;
|
||||||
|
@ -376,8 +376,8 @@ void SetupSwipeHandler(SwipeHandlerArgs &&args) {
|
||||||
return base::EventFilterResult::Continue;
|
return base::EventFilterResult::Continue;
|
||||||
};
|
};
|
||||||
widget->setAttribute(Qt::WA_AcceptTouchEvents);
|
widget->setAttribute(Qt::WA_AcceptTouchEvents);
|
||||||
state->filterContext = base::make_unique_q<QObject>(nullptr);
|
state->filter = base::unique_qptr<QObject>(
|
||||||
base::install_event_filter(state->filterContext.get(), widget, filter);
|
base::install_event_filter(widget, filter));
|
||||||
}
|
}
|
||||||
|
|
||||||
SwipeBackResult SetupSwipeBack(
|
SwipeBackResult SetupSwipeBack(
|
||||||
|
|
Loading…
Add table
Reference in a new issue