From kde-commits Fri Jun 12 23:38:59 2009 From: =?utf-8?q?Aaron=20J=2E=20Seigo?= Date: Fri, 12 Jun 2009 23:38:59 +0000 To: kde-commits Subject: KDE/kdebase/workspace/plasma/applets/quicklaunch Message-Id: <1244849939.103279.24357.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=124484994611384 SVN commit 981239 by aseigo: set the preferred size of the widget BUG:196205 M +9 -7 quicklaunchApplet.cpp --- trunk/KDE/kdebase/workspace/plasma/applets/quicklaunch/quicklaunchApplet.cpp #981238:981239 @@ -65,7 +65,7 @@ setHasConfigurationInterface(true); setAcceptDrops(true); setAspectRatioMode(Plasma::IgnoreAspectRatio); - connect(m_timer,SIGNAL(timeout()), this, SLOT(performUiRefactor())); + connect(m_timer, SIGNAL(timeout()), this, SLOT(performUiRefactor())); m_timer->setSingleShot(true); qreal left, top, right, bottom; @@ -190,6 +190,7 @@ clearLayout(m_dialogLayout); m_dialogLayout->setRowCount((int)(size().height() / qMin(m_dialogIconSize, m_dialog->size().height()))); } + int rowCount; if (formFactor() == Plasma::Vertical) { rowCount = contentsRect().width() / m_iconSize; @@ -237,6 +238,8 @@ m_arrow->hide(); } + setPreferredSize(m_layout->preferredSize() + QSize(4, 4)); + if (m_dialog) { m_dialog->close(); m_dialogLayout->updateGeometry(); @@ -387,17 +390,16 @@ if (pos >= m_icons.size()) { pos = m_icons.size() - 1; } - } else { QPointF point = event->pos(); for(int i = 0; i < m_dialogLayout->count(); i++) { QGraphicsLayoutItem *item = m_dialogLayout->itemAt(i); if (item->geometry().contains(point)) { - //m_dialogLayout->insertItem(dropedItem, i + 1); - pos = i+1+m_visibleIcons; - kDebug() << "The position of Droped Item in dialog is = " << pos; - break; - } + //m_dialogLayout->insertItem(dropedItem, i + 1); + pos = i + 1 + m_visibleIcons; + kDebug() << "The position of Droped Item in dialog is = " << pos; + break; + } } } if (dropHandler(pos, event->mimeData())) {