Skip to content

Commit

Permalink
ReaderHighlight: fix color for extended highlight in pdf (koreader#12654
Browse files Browse the repository at this point in the history
)

Closes koreader#12653.
  • Loading branch information
hius07 authored Oct 18, 2024
1 parent a4dcfd2 commit 54e33d2
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions frontend/apps/reader/modules/readerhighlight.lua
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,7 @@ Except when in two columns mode, where this is limited to showing only the previ
self.allow_corner_scroll = G_reader_settings:nilOrTrue("highlight_corner_scroll")
end,
})

-- we allow user to select the rate at which the content selection tool moves through screen
if not Device:isTouchDevice() and Device:hasDPad() then
table.insert(menu_items.long_press.sub_item_table, {
Expand Down Expand Up @@ -857,11 +858,9 @@ Except when in two columns mode, where this is limited to showing only the previ
UIManager:show(spin_widget)
end,
})
end

-- long_press setting is under taps_and_gestures menu which is not available for non-touch devices
-- Clone long_press setting and change its label, making it much more meaningful for non-touch device users.
if not Device:isTouchDevice() and Device:hasDPad() then
-- long_press setting is under taps_and_gestures menu which is not available for non-touch devices
-- Clone long_press setting and change its label, making it much more meaningful for non-touch device users.
menu_items.selection_text = menu_items.long_press
menu_items.selection_text.text = _("Selection on text")
menu_items.long_press = nil
Expand Down Expand Up @@ -1836,7 +1835,6 @@ function ReaderHighlight:getSelectedWordContext(nb_words)
end

function ReaderHighlight:viewSelectionHTML(debug_view, no_css_files_buttons)
if self.ui.paging then return end
if self.selected_text and self.selected_text.pos0 and self.selected_text.pos1 then
local ViewHtml = require("ui/viewhtml")
ViewHtml:viewSelectionHTML(self.ui.document, self.selected_text)
Expand Down Expand Up @@ -2413,7 +2411,7 @@ function ReaderHighlight:getSavedExtendedHighlightPage(highlight, page, index)
local item = {
datetime = highlight.datetime,
drawer = highlight.drawer,
color = highlight.color or self.highlight.saved_color,
color = highlight.color or self.view.highlight.saved_color,
text = highlight.text,
note = highlight.note,
page = highlight.page,
Expand Down

0 comments on commit 54e33d2

Please sign in to comment.