KiteHighlight

data class KiteHighlight(val hit: KiteSearchHit, val color: Color? = null, val edgeMarker: Boolean = false, val edgeMarkerColor: Color? = null, val edgeMarkerSide: KiteMarkerSide = KiteMarkerSide.End, val id: String? = null)

One entry of KiteDocViewState.highlights: where to paint (hit) plus how to paint it.

KiteSearchHit stays a pure text-search result, with no idea colours exist; this wraps one with the viewer's paint choices. Build the hit yourself from quads you already hold, or take it straight out of PdfDocument.search, EpubDocument.search or KiteStructuredText.search.

Parameters

hit

the page index and the display-space quads to cover.

color

fill for those quads. Null (the default) paints KiteDocViewColors.searchHighlight, exactly what KiteDocViewState.searchHighlights does, so wrapping a plain hit changes nothing on screen.

edgeMarker

also paint a small rounded marker in one page margin, level with this highlight. It tells a reader a note lives on this page without them having to find the highlighted words. Every dimension is a fraction of the rendered page width, so it keeps its proportions in a thumbnail and at deep zoom alike, and its inner edge is clamped past the highlighted quads so it never paints over the words. On a page whose text reaches into that margin, leaving no room, nothing is drawn.

edgeMarkerColor

fill for that marker. Null (the default) falls back to color, and then to KiteDocViewColors.searchHighlight. A marker usually wants a stronger, opaque colour than the translucent fill next to it.

edgeMarkerSide

which margin carries the marker. KiteMarkerSide.End is the pre-0.5.1 behaviour and stays the default.

Constructors

Link copied to clipboard
constructor(hit: KiteSearchHit, color: Color? = null, edgeMarker: Boolean = false, edgeMarkerColor: Color? = null, edgeMarkerSide: KiteMarkerSide = KiteMarkerSide.End, id: String? = null)

Properties

Link copied to clipboard
val color: Color?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val id: String?

Stable host identity, returned intact by KiteDocViewState.highlightAt.