summaryrefslogtreecommitdiffstats
path: root/src/completionentry.h
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-04 10:10:19 +0200
committerDanilo M. <danix@danix.xyz>2026-08-04 12:54:35 +0200
commitcf75b8ecf7d27fda217023507b8ed4df1f198613 (patch)
treee75025c35540d9422488fe51c3dcd2f53e9c8ff4 /src/completionentry.h
parent4df7edfc259fb3bdb3814ffe6549ecd3ee448578 (diff)
downloadqtmaildir-cf75b8ecf7d27fda217023507b8ed4df1f198613.tar.gz
qtmaildir-cf75b8ecf7d27fda217023507b8ed4df1f198613.zip
feat(completion): size the description column by need, not by half
The delegate split each row evenly between the value and its description. That reads as fair but spends the width on the wrong column: the values are short, the longest prefix being "attachment:", while the descriptions are ordinary prose. Measured against the built-in vocabulary, ten of fifteen descriptions elided at a 400px popup and the longest, "directory below the Maildir root", needed a ~650px popup to appear in full, all while the value's half of the row sat mostly empty. The descriptions are the whole reason the popup teaches the query language, so a half they cannot use is a half wasted. Measure the value and lend the description the remainder, capped at 65% of the row. Every built-in description now fits at ~500px instead of ~700px. The cap is what keeps a genuinely long value legible, and the value's own reservation is capped in turn so that "application/vnd.oasis.opendocument.text" elides itself rather than claiming the row and silencing the column that explains what it is. The test renders the real popup and reads the pixels back, since the delegate is private to the .cpp and legibility is a painting question. It asserts the painted width against the width the text needs unelided, not merely that something was drawn: a blank-or-not check passes against the very rule this replaces. 550px is chosen deliberately, being a width where the new rule paints the longest description in full and an even split cannot; against the old code it fails with "painted 261px of the 285px it needs". Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'src/completionentry.h')
0 files changed, 0 insertions, 0 deletions