diff --git a/applethandle.cpp b/applethandle.cpp index dc8cec390..64cc7f60a 100644 --- a/applethandle.cpp +++ b/applethandle.cpp @@ -66,11 +66,11 @@ AppletHandle::AppletHandle(Containment *parent, Applet *applet) m_rect.adjust(-HANDLE_WIDTH, -HANDLE_WIDTH, HANDLE_WIDTH, HANDLE_WIDTH); - if (m_applet->pos().x() <= ((HANDLE_WIDTH * 2) + ICON_SIZE + ICON_MARGIN)) { - m_rect.adjust(0.0, 0.0, ICON_MARGIN + ICON_SIZE, 0.0); + if (m_applet->pos().x() <= ((HANDLE_WIDTH * 2) + ICON_SIZE)) { + m_rect.adjust(0.0, 0.0, ICON_SIZE, 0.0); m_buttonsOnRight = true; } else { - m_rect.adjust(- ICON_MARGIN - ICON_SIZE, 0.0, 0.0, 0.0); + m_rect.adjust(- ICON_SIZE, 0.0, 0.0, 0.0); } m_applet->setParentItem(this); @@ -131,9 +131,9 @@ void AppletHandle::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti QPointF point = m_rect.topLeft(); if (m_buttonsOnRight) { - point += QPointF(m_rect.width() - ICON_SIZE - ICON_MARGIN, HANDLE_WIDTH); + point += QPointF(m_rect.width() - ICON_SIZE - HANDLE_WIDTH, HANDLE_WIDTH); } else { - point+= QPointF(HANDLE_WIDTH, HANDLE_WIDTH); + point+= QPointF(HANDLE_WIDTH / 2, HANDLE_WIDTH); } QPointF shiftC; @@ -173,7 +173,7 @@ AppletHandle::ButtonType AppletHandle::mapToButton(const QPointF &point) const QPointF basePoint = m_rect.topLeft(); if (m_buttonsOnRight) { - basePoint+= QPointF(m_rect.width() - ICON_SIZE - ICON_MARGIN, HANDLE_WIDTH); + basePoint+= QPointF(m_rect.width() - ICON_SIZE, HANDLE_WIDTH); } else { basePoint+= QPointF(HANDLE_WIDTH, HANDLE_WIDTH); } diff --git a/applethandle_p.h b/applethandle_p.h index 2b092943e..4e2393e17 100644 --- a/applethandle_p.h +++ b/applethandle_p.h @@ -60,7 +60,7 @@ class AppletHandle : public QObject, public QGraphicsItem void fadeAnimation(qreal progress); private: - static const int HANDLE_WIDTH = 10; + static const int HANDLE_WIDTH = 5; static const int ICON_SIZE = 16; static const int ICON_MARGIN = 8;