diff options
author | Eike Ziller <eike.ziller@qt.io> | 2017-07-18 10:23:43 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2017-07-26 07:16:25 +0000 |
commit | 3841d2fce27c9c7410c146a6be6693f5b7a8c4d3 (patch) | |
tree | 6d69382831b1f19442975b2181d7e7f767a1f117 /src/libs/3rdparty/cplusplus | |
parent | 574b9913109554e7f581c52e56c4615f57a658b5 (diff) |
Locator: Fix diverse issues with drawing highlighted text
To draw the result items with highlighted parts, we split the text to
draw into "before highlight", "highlight" and "after highlight", and
painted them separately. This had several issues:
It breaks the text layout. Characters within a text are often started at
subpixels, which was not so visible in the static search results, but
lead to ugly artifacts while typing in Locator (enter a search term, and
then continue adding characters that still match the first found item,
and watch the effect in the "after highlight" part).
It needs a lot of custom painting code. Properly supporting text elide
modes is hard, scaling to more than one highlight as well. Reusing parts
of the QItemDelegate base functions also has its issues, e.g. that
clipping doesn't work well.
Instead, QItemDelegate::drawDisplay should make it possible to set
format ranges for the text it draws. This patch copies part of
QItemDelegate to be able to add this parameter. Unfortunately Qt
currently has a bug (QTBUG-62019) that character backgrounds are not
painted far enough (1 pixel to the right has the wrong background), which
looks very ugly in selected items in the search results. So we use the
new delegate only for Locator for now, to be used later for the search
results too, when that bug is fixed.
Task-number: QTCREATORBUG-18532
Change-Id: Idf59b2c2bcfa6b188a810f7a3128a81e7e6fffb1
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/libs/3rdparty/cplusplus')
0 files changed, 0 insertions, 0 deletions