Highlight verses using tag folder color. Solves #968 - #1336
Conversation
|
I'm afraid this is getting worse. I have just 2 bookmarks that include Rev 22. But all versions are showing colorization as if I had a half dozen such bookmarks. |
|
I'll take a look at it next week, but I can already say that, strangely enough, I'm not getting the same errors as you—in Revelation, everything is displaying correctly. |
346afec to
43c615f
Compare
|
Regrets that yesterday's "render whole books" PR has rendered this PR conflicted...probably deeply so. It will have to be reworked against the updated architecture where one display function for main window no longer does all the work; rather that function does just the initial HTML header generation and then farms out the rendering work to a separate RenderOneChapter function and another RenderWholeBook function which calls RenderOneChapter repeatedly. It is possible that one type of error previously seen by me in this PR was caused in part by marginal module content involving paragraph breaks with improper trailing specifications. The paragraph ending problem has not one but rather two cases, both now handled. I hope I won't find any more in the future. As I mentioned elsewhere, I am out of town for a few days but I'll take another look at all of these when I get back. |
|
Do you plan on working on this, or should I take a look? I have to admit, if you have a little time, I'd be happy to let you handle it, but let me know! I really like your commit that lets you scroll through the entire Bible. I'm waiting for the last three PRs to be merged, and then I'll start translating the text that's still in English. Do you think it would make sense to release an new version once the three PRs are merged? These are some great new features! |
|
Finally I solved the conflict |
|
I intended to test the current state of this. However, notwithstanding the claim by GH of "no conflics with base", ...
I simply don't trust GH itself. I trust You may need just a rebase. |
- **Truncated multi-reference bookmarks**: `BackEnd::parse_verse_list()`
used `popError()` as a loop-termination condition, which also fires
when a single element in the list fails to resolve — silently
dropping every element after it, even valid ones. Switched to
indexed access (`getCount()` / `getElement()`), so one bad reference
no longer swallows the rest of a bookmark's verse list.
- **Unreadable text on dark tag colors**: the current-verse `<font
color="...">` wrapper was applied unconditionally, overriding the
contrast color already computed for the tag background. It's now
skipped whenever a tag color is active, so the computed
black/white contrast color is respected instead.
- **Major bug: verse text turning invisible for the rest of the
chapter**: the tag-color `<span>` and the current-verse/annotation
`<span><font>` were opened independently but shared a single,
under-conditioned closing statement. When a verse had a tag color
but wasn't the current verse, the highlight span was opened is
never opened but its closing tag was still emitted, corrupting the
HTML structure for every subsequent verse in the chapter. Each span
now tracks its own open/close state explicitly.
- **Strong's/morphology links ignoring computed contrast**: verse
numbers and linked words are colored via a global CSS `a:link`
rule, which overrides any `color` inherited from an ancestor
`<span>`. Added a `.tagcolor a:link { color: inherit !important }`
rule and tagged the relevant span with `class="tagcolor"` so link
text respects the computed contrast color too.
- **On/off toggle**: added "Colorize verses by folder color" as a
right-click checkbox item on the bookmarks tree (rather than
buried in Preferences), matching the existing "Popup menu for
cross-references" toggle added by crosswire#1335. Defaults to on, persists
across restarts, and takes effect immediately.
- **Status bar bookmark info on hover**: hovering (not clicking) a
verse number that belongs to a bookmark now shows "<containing
folder>: <bookmark name>" in the status bar, making it easier to
identify which of several similarly-colored bookmarks a verse
belongs to — without exposing the full nested folder path.
- The luminance/contrast calculation itself (`text_color_for_bg`)
was already correct; the "dark green on black" and "white on
white" issues were caused by other elements overriding its output,
not by the luminance formula.
Xiphos never called setlocale(LC_ALL, ""), relying instead on
gtk_init_with_args() to set the process locale implicitly as a
side effect. gettext (bindtextdomain/textdomain) was also only
initialized later, inside gui_init().
Both of these happen well after settings_init() -> init_bookmarks(),
which generates the user's default bookmarks.xml using _()-wrapped
strings ("What must I do to be saved?", "What is the Gospel?", etc.).
As a result, the default bookmarks were always written in English,
even when .po translations existed and the rest of the UI displayed
correctly in the user's language.
Move setlocale(LC_ALL, "") and the bindtextdomain/textdomain calls
to the very start of main(), before settings_init(). The later
calls in gui_init() are left in place and are harmless to repeat
(gettext initialization is idempotent).
44f1750 to
1af6621
Compare
|
@karlkleinpaste done. |








feat: highlight verses using tag folder color
This PR adds visual highlighting of Bible verses based on their bookmark tag color.
New behavior
When a verse is bookmarked inside a colored tag folder, it is highlighted in the Bible text using that folder's color. The text color is automatically adjusted (white or black) based on the background luminance to ensure readability.
Opting out
This feature is entirely driven by the tag color. If you do not want a tag folder to highlight its verses in the Bible text, simply remove its color (click "No color" when editing the folder). Folders without a color will not highlight any verses.
Details
display.ccviaget_tag_color_for_versekey()