koreader icon indicating copy to clipboard operation
koreader copied to clipboard

FR: Option to disable gray background when selecting text

Open SOREMUZ opened this issue 6 months ago • 5 comments

Does your feature request involve difficulty completing a task? Please describe.

I've noticed that when I long-press a word to look it up or highlight text (even though I've set the default highlight style to underline in settings), KOReader first briefly lightens the words and then applies the underline or showing up the popup menu. This seems to trigger a forced refresh on the screen to highlight the text.

Would it be possible to skip this temporary gray background and apply the underline (or trigger the popup) directly?

Describe the solution you'd like

For comparison,I’m using KOReader on my Onyx Boox Leaf 3,when using the native Boox system for text lookups/highlights with underlines, there's no screen flashing at all: https://github.com/user-attachments/assets/d1e42eb0-6524-4f18-aca4-816a6c59d200

Here’s KOReader’s behavior: https://github.com/user-attachments/assets/a0147ff4-de1c-4395-a81e-f328191a3a2c

I prefer using Koreader because the dictionary lookup experience is far better than the native Boox system,however the gray background really troubles me and I have no idea how to disable it.

SOREMUZ avatar Jun 17 '25 08:06 SOREMUZ

I like the idea. Although I generally do use the 'lighten' highlight style (albeit with the narrower width), it would be a lot gentler on the eyes if during the text selection itself only an underline would show, that would then convert into the chosen highlight style only on release of the pan.

jonnyl2 avatar Jun 17 '25 12:06 jonnyl2

Temporary highlights are drawn by crengine, permanent ones - by the frontend (supporting styles).

hius07 avatar Jun 17 '25 12:06 hius07

I like the idea. Although I generally do use the 'lighten' highlight style (albeit with the narrower width), it would be a lot gentler on the eyes if during the text selection itself only an underline would show, that would then convert into the chosen highlight style only on release of the pan.

Your suggestion sounds even better! It would be great if this could be added as an option in the future. I think Kindle does something similar too ,it just adds an underline when looking up a word, and there’s no forced refresh at all.

SOREMUZ avatar Jun 17 '25 12:06 SOREMUZ

Temporary highlights are drawn by crengine, permanent ones - by the frontend (supporting styles).

Thanks for the explanation,is there any way to change the style of the temporary highlights?I found a post mentioning the text selection background color, but I have no idea where data/cr3.ini is — I’ve searched the KOReader files but couldn’t locate it.

Just in case, crengine internal text selection background color can be changed and made white (so, just not noticable) by editing data/cr3.ini:


-crengine.highlight.selection.color=#c0c0c0

+crengine.highlight.selection.color=#FFFFFF

(actualy, setting it to black #000000 makes the text black on black and unreaderable, no option to force a white text color on this)

Is there any way to alter that?

Nope, I think it's a hardware behaviour on some devices.

I try to avoid using gray in my UI PRs when I can and the other dev allows it (or do not notice it :)

I also patch a few gray things to black in my own koreader patch (like the separator lines in the top menu) - as indeed, it feels like an animation...

Originally posted by @poire-z in #6932

SOREMUZ avatar Jun 17 '25 13:06 SOREMUZ

I have no idea where data/cr3.ini is — I’ve searched the KOReader files but couldn’t locate it.

On Android it is in the system directory (root): /data/data/org.koreader.launcher/files/data/cr3.ini

jonnyl2 avatar Jun 17 '25 13:06 jonnyl2