Review Request 110342: Dolphin Places: Make it easier to drag and drop items

Vishesh Handa me at vhanda.in
Wed May 8 09:23:52 BST 2013



> On May 8, 2013, 6:16 a.m., Frank Reininghaus wrote:
> > Many thanks for this patch, Vishesh! This is greatly appreciated. Thanks also for the testing and helpful comments, Emmanuel.
> > 
> > The existing solution was a quick hack to make it work just before the KDE 4.9.0 release (dropping stuff on items in the panel had been broken by Peter's panel rewrite) and far from optimal, as you have noticed.
> > 
> > I think the approach looks good! The only thing that does not quite work yet is related to the auto-activation issue that Emmanuel found: When hovering the center of an item and then moving to one of its edges, such that the "drop indicator" is shown, the item's icon is still highlighted.
> > 
> > Moreover, two little style issues:
> > 
> > (a) Is there a reason to replace "if (!droppingBetweenItems && m_model->supportsDropping(index))" by two nested "if"s? I don't think that this makes the code easier to read, but maybe it's a matter of taste.
> > 
> > (b) Put the "else" on the same line as the preceding closing brace: "} else {".

(a) I need an else for the if (!droppingBetweenItems) { .. }
(b) Fixed


- Vishesh


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/110342/#review32238
-----------------------------------------------------------


On May 7, 2013, 8:28 p.m., Vishesh Handa wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/110342/
> -----------------------------------------------------------
> 
> (Updated May 7, 2013, 8:28 p.m.)
> 
> 
> Review request for Dolphin.
> 
> 
> Description
> -------
> 
>     Dolphin Places: Make it easier to drag and drop items
>     
>     When doing a drop, a check is performed to see if it is within x pixels
>     from the top or x pixel from the bottom of the rect. If it is, then the
>     drop is considered a drop between items.
>     
>     This x was fixed to qMax( 4, myStyleOption.padding ) which would
>     generally be 4. This is fine for some cases, but when the rectangle size
>     increases then this 4 pixels is not enough. Hence this 'x' is now being
>     set to 30% of the rectangle height.
>     
>     By default the rectangle height is 20 pixels, so x is now 6 instead of 4
>     in the default case, which does make it slightly easier.
>     
>     Also, this in-between-items check is only performed when moving from one
>     item to another. This is not good since if you enter the item and the
>     bottom, the indicator is shown, and then as to start moving it up it
>     stops showing, and then it should start showing again as you approach
>     the top edge.
>     
>     Modified the code to run the check on every mouse drag event even if the
>     hovered item has not changed.
>     
>     Both these changes combined make it much easier to drag and drop items.
> 
> 
> Diffs
> -----
> 
>   dolphin/src/kitemviews/kitemlistcontroller.cpp c6239df 
>   dolphin/src/kitemviews/kitemlistview.cpp a2629c5 
> 
> Diff: http://git.reviewboard.kde.org/r/110342/diff/
> 
> 
> Testing
> -------
> 
> Much easier
> 
> 
> Thanks,
> 
> Vishesh Handa
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20130508/1bd7267e/attachment.htm>


More information about the kfm-devel mailing list