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:
@@ -1172,14 +1172,12 @@ function ReaderHighlight:onCycleHighlightAction()
|
||||
G_reader_settings:saveSetting("default_highlight_action", "highlight")
|
||||
UIManager:show(Notification:new{
|
||||
text = _("Default highlight action changed to 'highlight'."),
|
||||
timeout = 1,
|
||||
})
|
||||
else
|
||||
local next_action = next_actions[current_action]
|
||||
G_reader_settings:saveSetting("default_highlight_action", next_action)
|
||||
UIManager:show(Notification:new{
|
||||
text = T(_("Default highlight action changed to '%1'."), (next_action or "default")),
|
||||
timeout = 1,
|
||||
})
|
||||
end
|
||||
return true
|
||||
@@ -1195,7 +1193,6 @@ function ReaderHighlight:onCycleHighlightStyle()
|
||||
self.ui.doc_settings:saveSetting("highlight_drawer", self.view.highlight.saved_drawer)
|
||||
UIManager:show(Notification:new{
|
||||
text = T(_("Default highlight style changed to '%1'."), self.view.highlight.saved_drawer),
|
||||
timeout = 1,
|
||||
})
|
||||
return true
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user