diff --git a/plugins/vocabbuilder.koplugin/main.lua b/plugins/vocabbuilder.koplugin/main.lua index 0fc8683da..89e37f2a6 100644 --- a/plugins/vocabbuilder.koplugin/main.lua +++ b/plugins/vocabbuilder.koplugin/main.lua @@ -499,7 +499,13 @@ function WordInfoDialog:init() self.layout = {} if self.dismissable then if Device:hasKeys() then - self.key_events.Close = { { Device.input.group.Back } } + local back_group = util.tableDeepCopy(Device.input.group.Back) + if Device:hasFewKeys() then + table.insert(back_group, "Left") + else + table.insert(back_group, "Menu") + end + self.key_events.Close = { { back_group } } end if Device:isTouchDevice() then self.ges_events.Tap = { @@ -543,13 +549,6 @@ function WordInfoDialog:init() end } - local cancel_button = { - text = _("Cancel"), - callback = function() - UIManager:close(self) - end - } - local forgot_button = { text = _("Forgot"), callback = function() @@ -558,6 +557,14 @@ function WordInfoDialog:init() end } + local got_it_button = { + text = _("Got it"), + callback = function() + self.got_it_callback() + UIManager:close(self) + end + } + local update_button = { text = _("Overwrite"), callback = function() @@ -566,7 +573,7 @@ function WordInfoDialog:init() end } - local buttons = self.update_callback and {{cancel_button, forgot_button, update_button}} or {{reset_button, remove_button}} + local buttons = self.update_callback and {{got_it_button, forgot_button, update_button}} or {{reset_button, remove_button}} if self.vocabbuilder and self.vocabbuilder.item.last_due_time then table.insert(buttons, {{ text = _("Undo study status"), @@ -2130,6 +2137,10 @@ function VocabBuilder:onWordLookedUp(word, title, is_manual) DB:gotOrForgot(item, false) DB:batchUpdateItems({ item }) end, + got_it_callback = function() + DB:gotOrForgot(item, true) + DB:batchUpdateItems({ item }) + end, } UIManager:show(dialog) else