Page overlap: add "Horizontal line" marker (#10401)

reviewable/pr10418/r1
hius07 1 year ago committed by GitHub
parent 46f0bba74b
commit b4f453eb58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -211,6 +211,9 @@ function ReaderView:paintTo(bb, x, y)
local center_offset = bit.rshift(self.arrow.height, 1)
-- Paint at the proper y origin depending on wheter we paged forward (dim_area.y == 0) or backward
self.arrow:paintTo(bb, 0, self.dim_area.y == 0 and self.dim_area.h - center_offset or self.dim_area.y - center_offset)
elseif self.page_overlap_style == "line" then
bb:paintRect(0, self.dim_area.y == 0 and self.dim_area.h or self.dim_area.y,
self.dim_area.w, Size.line.medium, Blitbuffer.COLOR_BLACK)
end
end
-- draw saved highlight
@ -616,19 +619,19 @@ function ReaderView:drawHighlightRect(bb, _x, _y, rect, drawer, draw_note_mark)
if drawer == "lighten" then
bb:lightenRect(x, y, w, h, self.highlight.lighten_factor)
elseif drawer == "underscore" then
bb:paintRect(x, y + h - 1, w, 2, Blitbuffer.COLOR_GRAY)
bb:paintRect(x, y + h - 1, w, Size.line.medium, Blitbuffer.COLOR_GRAY)
elseif drawer == "strikeout" then
local line_y = y + math.floor(h / 2) + 1
if self.ui.paging then
line_y = line_y + 2
end
bb:paintRect(x, line_y, w, 2, Blitbuffer.COLOR_BLACK)
bb:paintRect(x, line_y, w, Size.line.medium, Blitbuffer.COLOR_BLACK)
elseif drawer == "invert" then
bb:invertRect(x, y, w, h)
end
if draw_note_mark then
if self.highlight.note_mark == "underline" then
bb:paintRect(x, y + h - 1, w, 2, Blitbuffer.COLOR_BLACK)
bb:paintRect(x, y + h - 1, w, Size.line.medium, Blitbuffer.COLOR_BLACK)
else
local note_mark_pos_x
if self.ui.paging or

@ -1,7 +1,8 @@
local FFIUtil = require("ffi/util")
local ReaderUI = require("apps/reader/readerui")
local UIManager = require("ui/uimanager")
local _ = require("gettext")
local T = require("ffi/util").template
local T = FFIUtil.template
local PageOverlap = {
text = _("Page overlap"),
@ -72,8 +73,9 @@ You can set how many lines are shown.]]),
local page_overlap_styles = {
arrow = _("Arrow"),
dim = _("Gray out"),
line = _("Horizontal line"),
}
for k, v in pairs(page_overlap_styles) do
for k, v in FFIUtil.orderedPairs(page_overlap_styles) do
table.insert(PageOverlap.sub_item_table, {
text_func = function()
local text = v

Loading…
Cancel
Save