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:
@@ -194,7 +194,6 @@ function TweakInfoWidget:onTap(arg, ges)
|
||||
Device.input.setClipboardText("\n"..self.css_text.."\n")
|
||||
UIManager:show(Notification:new{
|
||||
text = _("CSS text copied to clipboard"),
|
||||
timeout = 2
|
||||
})
|
||||
return true
|
||||
elseif ges.pos:notIntersectWith(self.movable.dimen) then
|
||||
@@ -777,7 +776,6 @@ function ReaderStyleTweak:editBookTweak(touchmenu_instance)
|
||||
if not editor.save_callback_called then
|
||||
UIManager:show(Notification:new{
|
||||
text = NOT_MODIFIED_MSG,
|
||||
timeout = 2,
|
||||
})
|
||||
-- This has to be the same message above and below: when
|
||||
-- discarding, we can't prevent these 2 notifications from
|
||||
|
||||
Reference in New Issue
Block a user