Add notification when toggling 'Ignore long-press on corners' via Dispatcher (#13605)
Some checks failed
macos / macOS 13 x86-64 🔨15.2 🎯10.15 (push) Has been cancelled
macos / macOS 14 ARM64 🔨15.4 🎯11.0 (push) Has been cancelled

This commit is contained in:
jonnyl2
2025-05-04 20:47:24 +00:00
committed by GitHub
parent 37c12d9d7a
commit a39d612f18
2 changed files with 11 additions and 2 deletions

View File

@@ -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 = {

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