move crereader margin options into defaults.lua

pull/419/head
chrox 11 years ago
parent 1fb4dfab95
commit 1cbc6b9669

@ -80,6 +80,12 @@ DKOPTREADER_CONFIG_DOC_DEFAULT_LANG_CODE = "eng" -- that have filenames start
-- feel free to add more entries in this list
DCREREADER_CONFIG_FONT_SIZES = {16, 20, 22, 24, 28, 32, 38, 44} -- range from 16 to 44
-- crereader margin sizes
-- margin {left, top, right, bottom} in pixels
DCREREADER_CONFIG_MARGIN_SIZES_SMALL = {6, 5, 2, 5}
DCREREADER_CONFIG_MARGIN_SIZES_MEDIUM = {15, 10, 10, 10}
DCREREADER_CONFIG_MARGIN_SIZES_LARGE = {25, 10, 20, 10}
-- gesture detector defaults
DGESDETECT_DISABLE_DOUBLE_TAP = true

@ -46,15 +46,15 @@ local CreOptions = {
name_text = S.PAGE_MARGIN,
toggle = {S.SMALL, S.MEDIUM, S.LARGE},
values = {
{6, 5, 2, 5},
{15, 10, 10, 10},
{25, 10, 20, 10},
DCREREADER_CONFIG_MARGIN_SIZES_SMALL,
DCREREADER_CONFIG_MARGIN_SIZES_MEDIUM,
DCREREADER_CONFIG_MARGIN_SIZES_LARGE,
},
default_value = {15, 10, 10, 10},
default_value = DCREREADER_CONFIG_MARGIN_SIZES_MEDIUM,
args = {
{6, 5, 2, 5},
{15, 10, 10, 10},
{25, 10, 20, 10},
DCREREADER_CONFIG_MARGIN_SIZES_SMALL,
DCREREADER_CONFIG_MARGIN_SIZES_MEDIUM,
DCREREADER_CONFIG_MARGIN_SIZES_LARGE,
},
event = "SetPageMargins",
},

@ -573,10 +573,10 @@ function ReaderView:onSetViewMode(new_mode)
end
function ReaderView:onSetPageMargins(margins)
local left = margins[1]
local top = margins[2]
local right = margins[3]
local bottom = margins[4]
local left = Screen:scaleByDPI(margins[1])
local top = Screen:scaleByDPI(margins[2])
local right = Screen:scaleByDPI(margins[3])
local bottom = Screen:scaleByDPI(margins[4])
self.ui.document:setPageMargins(left, top, right, bottom)
self.ui:handleEvent(Event:new("UpdatePos"))
return true

Loading…
Cancel
Save