mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Remove ShowFontMenu (#11904)
Some clean up, as suggested in <https://github.com/koreader/koreader/pull/11864#discussion_r1615312993>.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
local BD = require("ui/bidi")
|
||||
local CenterContainer = require("ui/widget/container/centercontainer")
|
||||
local ConfirmBox = require("ui/widget/confirmbox")
|
||||
local Device = require("device")
|
||||
local Event = require("ui/event")
|
||||
@@ -8,7 +7,6 @@ local FontList = require("fontlist")
|
||||
local InfoMessage = require("ui/widget/infomessage")
|
||||
local Input = Device.input
|
||||
local InputContainer = require("ui/widget/container/inputcontainer")
|
||||
local Menu = require("ui/widget/menu")
|
||||
local MultiConfirmBox = require("ui/widget/multiconfirmbox")
|
||||
local Notification = require("ui/widget/notification")
|
||||
local Screen = require("device").screen
|
||||
@@ -142,7 +140,6 @@ function ReaderFont:onGesture() end
|
||||
|
||||
function ReaderFont:registerKeyEvents()
|
||||
if Device:hasKeyboard() then
|
||||
self.key_events.ShowFontMenu = { { "F" } }
|
||||
if not (Device:hasScreenKB() or Device:hasSymKey()) then
|
||||
-- add shortcut for keyboard
|
||||
self.key_events.IncreaseSize = {
|
||||
@@ -196,34 +193,6 @@ function ReaderFont:onReadSettings(config)
|
||||
end)
|
||||
end
|
||||
|
||||
function ReaderFont:onShowFontMenu()
|
||||
-- build menu widget
|
||||
local main_menu = Menu:new{
|
||||
title = self.font_menu_title,
|
||||
item_table = self.face_table,
|
||||
width = Screen:getWidth() - 100,
|
||||
height = math.floor(Screen:getHeight() * 0.5),
|
||||
single_line = true,
|
||||
items_per_page = 8,
|
||||
items_font_size = Menu.getItemFontSize(8),
|
||||
}
|
||||
-- build container
|
||||
local menu_container = CenterContainer:new{
|
||||
dimen = Screen:getSize(),
|
||||
main_menu,
|
||||
}
|
||||
main_menu.close_callback = function()
|
||||
UIManager:close(menu_container)
|
||||
end
|
||||
-- show menu
|
||||
|
||||
main_menu.show_parent = menu_container
|
||||
|
||||
UIManager:show(menu_container)
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
--[[
|
||||
UpdatePos event is used to tell ReaderRolling to update pos.
|
||||
--]]
|
||||
|
||||
Reference in New Issue
Block a user