Native UI highlights matched search queries |
||
Issue descriptionCurrently I am thinking to use base::i18n::FixedPatternStringSearchIgnoringCaseAndAccents to return the first matched query offset. About the UI, there are two options: 1. Use StyledLabel to set the range, when I prototyping it, I find I need to clear the style_ranges_ for each query. So we need to exposure a function for style_ranges_.clear. https://cs.chromium.org/chromium/src/ui/views/controls/styled_label.h?l=171&rcl=8927a8f42aca203f80c0bd258e637936e65d0c41 2. We can also use render text RenderText::ApplyColor(SkColor value, const Range& range) and ApplyStyle to set the matched styles. https://cs.chromium.org/chromium/src/ui/gfx/render_text.cc?l=694&rcl=0345c402fff1f9e3b389b6b1891aa0f90bc1598f Option 1 looks easier, but it cannot be used together with other ranges styles in the text because it will clear the style_ranges_ for each query. Unless we have two style_ranges_ and search_highlight_reanges_?
,
Jan 17 2018
Thanks msw@. in current UX mock of KSV, we do not need to use together with other ranged styles. We only highlight the left column text in the mock, not the right column text with the bubbles. Even in the future we need to use together, your random ideas would make it work! Sounds like a very small cl for this feature. Thanks.
,
Jul 2
|
||
►
Sign in to add a comment |
||
Comment 1 by msw@chromium.org
, Jan 17 2018