tighten up the applet handles a little more even

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=738555
This commit is contained in:
Aaron J. Seigo 2007-11-19 07:23:07 +00:00
parent 0006ce0ec4
commit 85e8a49d7c
2 changed files with 7 additions and 7 deletions

View File

@ -66,11 +66,11 @@ AppletHandle::AppletHandle(Containment *parent, Applet *applet)
m_rect.adjust(-HANDLE_WIDTH, -HANDLE_WIDTH, HANDLE_WIDTH, HANDLE_WIDTH); m_rect.adjust(-HANDLE_WIDTH, -HANDLE_WIDTH, HANDLE_WIDTH, HANDLE_WIDTH);
if (m_applet->pos().x() <= ((HANDLE_WIDTH * 2) + ICON_SIZE + ICON_MARGIN)) { if (m_applet->pos().x() <= ((HANDLE_WIDTH * 2) + ICON_SIZE)) {
m_rect.adjust(0.0, 0.0, ICON_MARGIN + ICON_SIZE, 0.0); m_rect.adjust(0.0, 0.0, ICON_SIZE, 0.0);
m_buttonsOnRight = true; m_buttonsOnRight = true;
} else { } 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); m_applet->setParentItem(this);
@ -131,9 +131,9 @@ void AppletHandle::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti
QPointF point = m_rect.topLeft(); QPointF point = m_rect.topLeft();
if (m_buttonsOnRight) { 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 { } else {
point+= QPointF(HANDLE_WIDTH, HANDLE_WIDTH); point+= QPointF(HANDLE_WIDTH / 2, HANDLE_WIDTH);
} }
QPointF shiftC; QPointF shiftC;
@ -173,7 +173,7 @@ AppletHandle::ButtonType AppletHandle::mapToButton(const QPointF &point) const
QPointF basePoint = m_rect.topLeft(); QPointF basePoint = m_rect.topLeft();
if (m_buttonsOnRight) { if (m_buttonsOnRight) {
basePoint+= QPointF(m_rect.width() - ICON_SIZE - ICON_MARGIN, HANDLE_WIDTH); basePoint+= QPointF(m_rect.width() - ICON_SIZE, HANDLE_WIDTH);
} else { } else {
basePoint+= QPointF(HANDLE_WIDTH, HANDLE_WIDTH); basePoint+= QPointF(HANDLE_WIDTH, HANDLE_WIDTH);
} }

View File

@ -60,7 +60,7 @@ class AppletHandle : public QObject, public QGraphicsItem
void fadeAnimation(qreal progress); void fadeAnimation(qreal progress);
private: private:
static const int HANDLE_WIDTH = 10; static const int HANDLE_WIDTH = 5;
static const int ICON_SIZE = 16; static const int ICON_SIZE = 16;
static const int ICON_MARGIN = 8; static const int ICON_MARGIN = 8;