[xiphos-source] [crosswire/xiphos] a9dd21: Highlight verses using tag folder color. Solves #9...
LAfricain
noreply at github.com
Thu Aug 6 08:53:55 EDT 2026
Branch: refs/heads/master
Home: https://github.com/crosswire/xiphos
Commit: a9dd210f24cc8744043e5d6e5e047e66aaa786c2
https://github.com/crosswire/xiphos/commit/a9dd210f24cc8744043e5d6e5e047e66aaa786c2
Author: L'Africain <fr.cyrille at tiberiade.be>
Date: 2026-08-06 (Thu, 06 Aug 2026)
Changed paths:
M src/backend/sword_main.cc
M src/gtk/bookmarks_menu.c
M src/gtk/bookmarks_treeview.c
M src/gui/bookmarks_menu.h
M src/gui/bookmarks_treeview.h
M src/main/display.cc
M src/main/main.c
M src/main/settings.c
M src/main/settings.h
M src/main/url.cc
M ui/xi-menus-popup.gtkbuilder
M ui/xi-menus.glade
Log Message:
-----------
Highlight verses using tag folder color. Solves #968 (#1336)
* Highlight verses using tag folder color. Solves #968
- **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 #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.
* Fix default bookmarks always created in English regardless of locale
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).
---------
Co-authored-by: lafricain79 <lafricain79 at gmail.com>
To unsubscribe from these emails, change your notification settings at https://github.com/crosswire/xiphos/settings/notifications
More information about the xiphos-source
mailing list