mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Refactored menu
While looking into #1219 I accidentally ended up refactoring some stuff. Tested in emulator and on H2O, but be wary because I might have overlooked something.
This commit is contained in:
@@ -34,7 +34,6 @@ function ReaderFrontLight:init()
|
||||
}
|
||||
},
|
||||
}
|
||||
self.ui.menu:registerToMainMenu(self)
|
||||
end
|
||||
|
||||
end
|
||||
@@ -79,20 +78,10 @@ function ReaderFrontLight:onPanRelease(arg, ges)
|
||||
return self:onShowIntensity()
|
||||
end
|
||||
|
||||
function ReaderFrontLight:addToMainMenu(tab_item_table)
|
||||
-- insert fldial command to setting tab of reader menu
|
||||
table.insert(tab_item_table.setting, {
|
||||
text = _("Frontlight settings"),
|
||||
callback = function()
|
||||
self:onShowFlDialog()
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
function ReaderFrontLight:onShowFlDialog()
|
||||
local powerd = Device:getPowerDevice()
|
||||
self.fl_dialog = InputDialog:new{
|
||||
title = _("Frontlight Level"),
|
||||
title = _("Frontlight level"),
|
||||
input_hint = ("(%d - %d)"):format(powerd.fl_min, powerd.fl_max),
|
||||
buttons = {
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user