D11664: added support for Drag (on) and Drop (off) the bookmark toolbar

David Rosca noreply at phabricator.kde.org
Mon Mar 26 12:27:10 BST 2018


drosca requested changes to this revision.
drosca added inline comments.
This revision now requires changes to proceed.
Restricted Application added a subscriber: falkon.

INLINE COMMENTS

> bookmarkstoolbar.cpp:306
> +
> +void BookmarksToolbar::clearDropIndicator()
> +{

This should also call `update()` so you don't need to always call it after `clearDropIndicator()`-

> bookmarkstoolbar.cpp:319
> +        painter.setPen(QPen(color, 2));
> +        painter.drawLine(m_dropXCoord,0,m_dropXCoord,height());
> +    }

There is already code to draw drop indicator in ComboTabBar. It should be extracted from there to eg. QzTools and use it both here and in ComboTabBar.

> bookmarkstoolbarbutton.cpp:316
> +        if ((event->pos() - m_dragStartPosition).manhattanLength() > QApplication::startDragDistance()) {
> +            m_dragInProgress = true;
> +        }

You don't need to store that drag is in progress as drags are sync.

> bookmarkstoolbarbutton.cpp:327
> +    mime->setImageData(m_bookmark->icon().pixmap(16).toImage());
> +    mime->setProperty("already-button", pos());
> +

How does dragging between windows work?

It should use custom mimedata with BookmarkItem pointer (see TabModel).

> bookmarkstoolbarbutton.cpp:331
> +    drag->setPixmap(grab());
> +    drag->exec();
> +}

It starts drag on every mouse move event (with pressed mouse button)? Why is it calculating start drag distance then?

REPOSITORY
  R875 Falkon

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

To: anmolgautam, drosca, #falkon
Cc: falkon, herrold, ixoos, anmolgautam, iodelay, spoorun, navarromorales, cochise, clivej, ach
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/falkon/attachments/20180326/6d81a951/attachment.html>


More information about the Falkon mailing list