<table><tr><td style="">rjvbb updated this revision to Diff 49947.<br />rjvbb added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D18380">View Revision</a></tr></table><br /><div><div><p>Final attempt at being a bit clever :)</p>
<p>Entering "narrow mode" now also sets the font stretch (exitting the mode will reset the stretch), the same as the Mac Finder will do. I use factor 83, which corresponds roughly to making a 12pt font as wide as a 10pt font.<br />
Setting stretch does not seem to have any effect when done in the handler slot, so it has to be done together with the width adaptation. That means the size and date columns need to be stretched too otherwise they will be too wide; I find that condensing them by half as much as the font gives a satisfactory result. The gained pixels are added to the name column.</p>
<p>Tested with a range of fonts and font sizes I find this to work pretty well. NB: the default UI font doesn't seem to support stretch; the code detect this by comparing <tt style="background: #ebebeb; font-size: 13px;">QFontMetrics::avCharWidth()</tt> before and after setting the stretch.</p>
<p>The look *is* slightly different with the condensed font, but theoretically it's only a quantitative difference ;)</p></div></div><br /><div><strong>CHANGES SINCE LAST UPDATE</strong><div><a href="https://phabricator.kde.org/D18380?vs=49908&id=49947">https://phabricator.kde.org/D18380?vs=49908&id=49947</a></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D18380">https://phabricator.kde.org/D18380</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/filewidgets/kdiroperatordetailview.cpp<br />
src/filewidgets/kdiroperatordetailview_p.h</div></div></div><br /><div><strong>To: </strong>rjvbb, ngraham<br /><strong>Cc: </strong>kde-frameworks-devel, michaelh, ngraham, bruns<br /></div>