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

Mark Gaiser noreply at phabricator.kde.org
Sun Jan 27 17:40:48 GMT 2019


markg added a comment.


  In D18380#400903 <https://phabricator.kde.org/D18380#400903>, @ngraham wrote:
  
  > In D18380#400896 <https://phabricator.kde.org/D18380#400896>, @markg wrote:
  >
  > > In QHeaderView code, what we want is "QHeaderView::Interactive" [1] followed by QHeaderView::resizeSection [2]. Exactly as [1] described! QHeaderView merely lacks a convenience function for this, that is what we have to implement!
  >
  >
  > Using that alone results in a visual and functional regression of the original problem we were trying to fix (that file dialogs don't have a sensible default view):
  >
  > F6570515: Regression.png <https://phabricator.kde.org/F6570515>
  >
  > If we go with this route, I would want to make sure we preserve the current behavior of other columns being right-aligned, and also make sure that the Name column has a good default width. If we can ensure that, I'm all for it!
  
  
  Lol :)
  It wasn't meant as a direct drop-in replacement for Rene's patch. KIO probably sets more on the headerview that isn't applied now (i assume). And if it doesn't then some things do need to be set to make it look nice.  It's merely meant to demonstrate that you can change the width of a column to whatever you desire while keeping the resizable feature and without the need to catch events and do magic there.
  
  Anyhow, you basically want a "stretchFirstColumn" while keeping. I named it "stretchColumn" but as it is now it only works if one column uses it. You need more complex layouting to get that to work if you want to stretch over multiple columns. But that's not the case here.
  Here it is. [1: header], [2: source], and a example on how to use it [3]. This obviously is far from done, but again only to demonstrate. If you like this approach i can put some time in it to make it less sensitive to errors.
  **be aware** to call "stretchColumn" after you show the dialog! Otherwise the sizes haven't been calculated yet. If you do exec, you can get around it by doing a QTimer::singleShot.
  
  [1] https://p.sc2.nl/H1S-2DomE
  [2] https://p.sc2.nl/ryQ2hwoX4
  [3] https://p.sc2.nl/Bybanvj7V

REPOSITORY
  R241 KIO

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

To: rjvbb, ngraham, #frameworks, #dolphin, apol, dfaure, ahartmetz, markg
Cc: markg, cfeck, dhaumann, kwrite-devel, kde-frameworks-devel, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20190127/8a97ea21/attachment.htm>


More information about the kfm-devel mailing list