mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
add screen rotate to readerconfig
This commit is contained in:
@@ -4,6 +4,19 @@ CreOptions = {
|
||||
prefix = 'copt',
|
||||
default_options = {
|
||||
},
|
||||
{
|
||||
icon = "resources/icons/appbar.transform.rotate.right.large.png",
|
||||
options = {
|
||||
{
|
||||
name="screen_mode",
|
||||
name_text = "Screen Mode",
|
||||
item_text = {"portrait", "landscape"},
|
||||
args = {"portrait", "landscape"},
|
||||
default_arg = nil,
|
||||
event = "SetScreenViewMode",
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
icon = "resources/icons/appbar.column.two.large.png",
|
||||
options = {
|
||||
|
||||
@@ -26,7 +26,9 @@ KoptOptions = {
|
||||
name="screen_mode",
|
||||
name_text = "Screen Mode",
|
||||
item_text = {"portrait", "landscape"},
|
||||
-- TODO: add screen mode changing command
|
||||
args = {"portrait", "landscape"},
|
||||
default_arg = nil,
|
||||
event = "SetScreenViewMode",
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -91,15 +91,10 @@ function ReaderConfig:onShowConfigMenu()
|
||||
end
|
||||
end
|
||||
|
||||
local dialog_container = CenterContainer:new{
|
||||
config_dialog,
|
||||
dimen = self.dimen:copy(),
|
||||
}
|
||||
config_dialog.close_callback = function ()
|
||||
UIManager:close(menu_container)
|
||||
UIManager:close(config_dialog)
|
||||
end
|
||||
|
||||
self.dialog_container = dialog_container
|
||||
self.config_dialog = config_dialog
|
||||
|
||||
UIManager:show(config_dialog)
|
||||
|
||||
@@ -116,6 +111,11 @@ function ReaderConfig:onSetDimensions(dimen)
|
||||
self.dimen.y = 7 * Screen:getHeight() / 8
|
||||
self.dimen.w = Screen:getWidth()
|
||||
self.dimen.h = Screen:getHeight() / 8
|
||||
-- since we cannot redraw config_dialog with new size, we close the old
|
||||
-- one it on screen size change
|
||||
if self.config_dialog then
|
||||
self.config_dialog.close_callback()
|
||||
end
|
||||
end
|
||||
|
||||
function ReaderConfig:onReadSettings(config)
|
||||
|
||||
Reference in New Issue
Block a user