Change the margin between dock and dock-preview to 8px

tower: https://tower.im/projects/715dbdd34f694ea08f6de7888b7ffd7d/todos/2e019ab602a14e40b8b95c6a37d78d08/

Change-Id: If4ab0deb9518df929a9a5a2ddb64d5c3580f30f9
This commit is contained in:
杨万青 2015-10-27 14:54:31 +08:00 committed by mr.asianwang
parent 4bb9a8d0bd
commit e10513fb45
Notes: Deepin Code Review 2016-06-14 07:19:47 +00:00
Verified+1: Anonymous Coward #1000004
Verified+1: <yefei@linuxdeepin.com>
Code-Review+2: <mr.asianwang@gmail.com>
Submitted-by: <mr.asianwang@gmail.com>
Submitted-at: Wed, 28 Oct 2015 12:57:04 +0800
Reviewed-on: https://cr.deepin.io/8073
Project: dde/dde-dock
Branch: refs/heads/master
4 changed files with 6 additions and 3 deletions

View File

@ -59,7 +59,7 @@ void PluginItemWrapper::enterEvent(QEvent *)
if (hoverable()) {
QRect rec = QApplication::desktop()->screenGeometry();
showPreview(QPoint(globalX() + width() / 2, rec.height() - DockModeData::instance()->getDockHeight() - 4));
showPreview(QPoint(globalX() + width() / 2, rec.height() - DockModeData::instance()->getDockHeight() - DOCK_PREVIEW_MARGIN));
}
}

View File

@ -34,6 +34,7 @@ private:
QString m_id;
QJsonObject createMenuItem(QString itemId, QString itemName, bool checkable, bool checked);
const int DOCK_PREVIEW_MARGIN = 7;
};
#endif // PLUGINITEMWRAPPER_H

View File

@ -141,7 +141,7 @@ void AbstractDockItem::showPreview(const QPoint &previewPos)
return;
}
QPoint pos = previewPos.isNull() ? QPoint(globalX() + width() / 2, globalY() - 5) : previewPos;
QPoint pos = previewPos.isNull() ? QPoint(globalX() + width() / 2, globalY() - DOCK_PREVIEW_MARGIN) : previewPos;
if (getApplet() == NULL) {
QString title = getTitle();
if (!title.isEmpty()) {
@ -150,7 +150,8 @@ void AbstractDockItem::showPreview(const QPoint &previewPos)
m_titlePreview->setArrowX(-1); //reset position
m_titlePreview->setContent(m_titleLabel);
m_titlePreview->showPreview(pos.x(),
pos.y() + 5 -
pos.y() + DOCK_PREVIEW_MARGIN -
2 - //minute adjustment
m_titlePreview->shadowYOffset() +
m_titlePreview->shadowBlurRadius() +
m_titlePreview->shadowDistance(),

View File

@ -96,6 +96,7 @@ private:
const int TITLE_HEIGHT = 20;
const int CONTENT_PREVIEW_INTERVAL = 200;
const int TITLE_PREVIEW_INTERVAL = 0;
const int DOCK_PREVIEW_MARGIN = 8;
};
#endif // ABSTRACTDOCKITEM_H