mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Notification: closed by any event, but not consuming it
Make Notification have toast=true, and UIManager deal specifically with such widget: a "toast" widget gets closed by any event, and let the event be handled by a lower widget. This should allow us to not wait or tap to get rid of a notification, and just go on with what we're doing. Also make them have a default timeout of 2s, used with all existing ones.
This commit is contained in:
@@ -508,7 +508,6 @@ function ReaderLink:onClearLocationStack(show_notification)
|
||||
if show_notification then
|
||||
UIManager:show(Notification:new{
|
||||
text = _("Location history cleared."),
|
||||
timeout = 2,
|
||||
})
|
||||
end
|
||||
return true
|
||||
@@ -758,7 +757,6 @@ function ReaderLink:onGoBackLink(show_notification_if_empty)
|
||||
elseif show_notification_if_empty then
|
||||
UIManager:show(Notification:new{
|
||||
text = _("Location history is empty."),
|
||||
timeout = 2,
|
||||
})
|
||||
end
|
||||
end
|
||||
@@ -780,7 +778,6 @@ function ReaderLink:onSwipe(arg, ges)
|
||||
-- so the user knows why
|
||||
UIManager:show(Notification:new{
|
||||
text = _("Location history is empty."),
|
||||
timeout = 2,
|
||||
})
|
||||
return true
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user