On Jan 2, 2008 10:45 PM, Jason Stubbs <<a href="mailto:jasonbstubbs@gmail.com">jasonbstubbs@gmail.com</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">On Thursday 03 January 2008 13:20:15 JST, Christopher Blauvelt wrote:<br>> Attached is a patch which will allow you to move icons when clicking on the<br>> icon itself rather than just the clicking on the handle. This time with
<br>> fewer style violations. :)<br><br><br></div></div>- if (boundingRect().contains(event->pos())) {<br>- if (~d->states & Private::HoverState) {<br>- d->states |= Private::HoverState;
<br>- update();<br>- }<br>- } else {<br>- if (d->states & Private::HoverState) {<br>- d->states &= ~Private::HoverState;<br>- update();<br>- }<br>- }
<br>+ d->states |= Private::MovedState;<br><br><br>Why is the HoverState stuff being removed? In fact, it looks like none of the<br>libs/plasma/widgets/icon.* changes are necessary...</blockquote><div><br>The hover state is removed because the icon now moves with the cursor. You don't have to worry about the cursor not being on the icon during a mouseMoveEvent.
<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br><br><br>+#include <plasma/corona.h></blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><br><br>This also doesn't look necessary...</blockquote><div><br>You're right it's not. I meant to remove it before submitting.<br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br><br><br>- double width = qBound(minimumSize().width(), iconSize.width(),<br>
maximumSize().width());<br>- double height = qBound(minimumSize().height(), iconSize.height(),<br>maximumSize().height());<br>+ qreal width = qBound(minimumSize().width(), iconSize.width(),<br>maximumSize().width());
<br>+ qreal height = qBound(minimumSize().height(), iconSize.height(),<br>maximumSize().height());<br><br><br>These sorts of changes (while correct) make patches harder to review.<br><br><br>+ QGraphicsItem* appletHandle = parentItem();
<br>+<br>+ if(appletHandle) {<br>+ //don't move the icon as well because appletHandle will do it for us<br>+ appletHandle->moveBy(delta.x(),delta.y());<br><br><br>I haven't tested this, but it looks like this would move the entire panel when
<br>dragging an icon applet that's within the panel. I wonder if AppletHandle<br>can't listen for position changes somehow and update itself...</blockquote><div><br>You're right it does. So either there needs to be a way to tell if we have an applethandle or not or applethandle needs to be able to respond to applet moves.
<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br><font color="#888888"><br>--<br>Jason Stubbs<br>_______________________________________________
<br>Panel-devel mailing list<br><a href="mailto:Panel-devel@kde.org">Panel-devel@kde.org</a><br><a href="https://mail.kde.org/mailman/listinfo/panel-devel" target="_blank">https://mail.kde.org/mailman/listinfo/panel-devel
</a><br></font></blockquote></div><br>