Add notification when toggling 'Ignore long-press on corners' via Dispatcher (#13605)

This commit is contained in:
jonnyl2 authored and GitHub committed 2025-05-04 22:47:24 +02:00
1 parent 37c12d9d7a
commit a39d612f18
2 files changed
+11 -2

No files matched your search

@@ -280,7 +280,7 @@ if Device:isTouchDevice() then
return G_reader_settings:isTrue("ignore_hold_corners")
end,
callback = function()
UIManager:broadcastEvent(Event:new("IgnoreHoldCorners"))
UIManager:broadcastEvent(Event:new("IgnoreHoldCorners", nil, true)) -- no notification
end,
}
common_settings.screen_disable_double_tap = {
+10 -1
View File
@@ -1196,13 +1196,22 @@ function Gestures:multiswipeAction(multiswipe_directions, ges)
end
end
function Gestures:onIgnoreHoldCorners(ignore_hold_corners)
function Gestures:onIgnoreHoldCorners(ignore_hold_corners, no_notification)
if ignore_hold_corners == nil then
G_reader_settings:flipNilOrFalse("ignore_hold_corners")
else
G_reader_settings:saveSetting("ignore_hold_corners", ignore_hold_corners)
end
self.ignore_hold_corners = G_reader_settings:isTrue("ignore_hold_corners")
if no_notification then return true end
local Notification = require("ui/widget/notification")
if G_reader_settings:readSetting("ignore_hold_corners") then
Notification:notify(_("Ignore long-press on corners: on"))
else
Notification:notify(_("Ignore long-press on corners: off"))
end
return true
end