From 54e33d27ea32f4feb99266dca9b42a53dc24e5cf Mon Sep 17 00:00:00 2001 From: hius07 <62179190+hius07@users.noreply.github.com> Date: Fri, 18 Oct 2024 21:59:31 +0300 Subject: [PATCH] ReaderHighlight: fix color for extended highlight in pdf (#12654) Closes #12653. --- frontend/apps/reader/modules/readerhighlight.lua | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/frontend/apps/reader/modules/readerhighlight.lua b/frontend/apps/reader/modules/readerhighlight.lua index b0813c45d2e0..055c0195d34c 100644 --- a/frontend/apps/reader/modules/readerhighlight.lua +++ b/frontend/apps/reader/modules/readerhighlight.lua @@ -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, { @@ -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 @@ -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) @@ -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,