D18380: KIO: make file dialog columns resizable again (and movable)

René J.V. Bertin noreply at phabricator.kde.org
Sun Jan 20 16:34:36 GMT 2019


rjvbb updated this revision to Diff 49947.
rjvbb added a comment.


  Final attempt at being a bit clever :)
  
  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.
  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.
  
  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 `QFontMetrics::avCharWidth()` before and after setting the stretch.
  
  The look *is* slightly different with the condensed font, but theoretically it's only a quantitative difference ;)

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D18380?vs=49908&id=49947

REVISION DETAIL
  https://phabricator.kde.org/D18380

AFFECTED FILES
  src/filewidgets/kdiroperatordetailview.cpp
  src/filewidgets/kdiroperatordetailview_p.h

To: rjvbb, ngraham
Cc: kde-frameworks-devel, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190120/a28f74d0/attachment.html>


More information about the Kde-frameworks-devel mailing list