From f10ea7d3394907aaab212bb3cf5893314a9eebe2 Mon Sep 17 00:00:00 2001 From: poire-z Date: Mon, 31 Oct 2022 23:15:42 +0100 Subject: [PATCH] TextViewer: allow close on any multiswipe (#9720) Similar to most fullscreen widgets. --- frontend/ui/widget/textviewer.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/frontend/ui/widget/textviewer.lua b/frontend/ui/widget/textviewer.lua index 71e2ff30e..324a98d0a 100644 --- a/frontend/ui/widget/textviewer.lua +++ b/frontend/ui/widget/textviewer.lua @@ -107,6 +107,16 @@ function TextViewer:init() } }, }, + MultiSwipe = { + GestureRange:new{ + ges = "multiswipe", + range = Geom:new{ + x = 0, y = 0, + w = Screen:getWidth(), + h = Screen:getHeight(), + } + }, + }, } end @@ -294,6 +304,14 @@ function TextViewer:onTapClose(arg, ges_ev) return true end +function TextViewer:onMultiSwipe(arg, ges_ev) + -- For consistency with other fullscreen widgets where swipe south can't be + -- used to close and where we then allow any multiswipe to close, allow any + -- multiswipe to close this widget too. + self:onClose() + return true +end + function TextViewer:onClose() UIManager:close(self) if self.close_callback then