mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
refactor: fix some typos
Change-Id: If7f13f449f5156e359b0501d7a65ee66525a97f9
This commit is contained in:
parent
6e97aa0f6f
commit
30bbae4407
Notes:
gerrit
2018-03-20 08:51:36 +00:00
Verified+1: Anonymous Coward #1000004 Code-Review+2: 石博文 <sbw@sbw.so> Submitted-by: 石博文 <sbw@sbw.so> Submitted-at: Tue, 20 Mar 2018 08:51:36 +0000 Reviewed-on: https://cr.deepin.io/32840 Project: dde/dde-dock Branch: refs/heads/master
@ -112,7 +112,7 @@ AppItem::AppItem(const QDBusObjectPath &entry, QWidget *parent)
|
|||||||
m_swingEffectView(new QGraphicsView(this)),
|
m_swingEffectView(new QGraphicsView(this)),
|
||||||
m_itemScene(new QGraphicsScene(this)),
|
m_itemScene(new QGraphicsScene(this)),
|
||||||
|
|
||||||
m_draging(false),
|
m_dragging(false),
|
||||||
|
|
||||||
m_appIcon(QPixmap()),
|
m_appIcon(QPixmap()),
|
||||||
|
|
||||||
@ -237,7 +237,7 @@ void AppItem::paintEvent(QPaintEvent *e)
|
|||||||
{
|
{
|
||||||
DockItem::paintEvent(e);
|
DockItem::paintEvent(e);
|
||||||
|
|
||||||
if (m_draging || (m_swingEffectView->isVisible() && DockDisplayMode != Fashion))
|
if (m_dragging || (m_swingEffectView->isVisible() && DockDisplayMode != Fashion))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QPainter painter(this);
|
QPainter painter(this);
|
||||||
@ -471,7 +471,7 @@ const QString AppItem::contextMenu() const
|
|||||||
|
|
||||||
QWidget *AppItem::popupTips()
|
QWidget *AppItem::popupTips()
|
||||||
{
|
{
|
||||||
if (m_draging)
|
if (m_dragging)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
if (!m_windowInfos.isEmpty())
|
if (!m_windowInfos.isEmpty())
|
||||||
@ -488,7 +488,7 @@ QWidget *AppItem::popupTips()
|
|||||||
|
|
||||||
void AppItem::startDrag()
|
void AppItem::startDrag()
|
||||||
{
|
{
|
||||||
m_draging = true;
|
m_dragging = true;
|
||||||
update();
|
update();
|
||||||
|
|
||||||
const QPixmap &dragPix = m_appIcon;
|
const QPixmap &dragPix = m_appIcon;
|
||||||
@ -506,7 +506,7 @@ void AppItem::startDrag()
|
|||||||
if (!drag->target())
|
if (!drag->target())
|
||||||
m_itemEntryInter->RequestUndock();
|
m_itemEntryInter->RequestUndock();
|
||||||
|
|
||||||
m_draging = false;
|
m_dragging = false;
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ private:
|
|||||||
QGraphicsScene *m_itemScene;
|
QGraphicsScene *m_itemScene;
|
||||||
QGraphicsItemAnimation m_itemAnimation;
|
QGraphicsItemAnimation m_itemAnimation;
|
||||||
|
|
||||||
bool m_draging;
|
bool m_dragging;
|
||||||
bool m_active;
|
bool m_active;
|
||||||
WindowInfoMap m_windowInfos;
|
WindowInfoMap m_windowInfos;
|
||||||
QString m_id;
|
QString m_id;
|
||||||
|
@ -40,7 +40,7 @@ PluginsItem::PluginsItem(PluginsItemInterface* const pluginInter, const QString
|
|||||||
m_pluginInter(pluginInter),
|
m_pluginInter(pluginInter),
|
||||||
m_centralWidget(m_pluginInter->itemWidget(itemKey)),
|
m_centralWidget(m_pluginInter->itemWidget(itemKey)),
|
||||||
m_itemKey(itemKey),
|
m_itemKey(itemKey),
|
||||||
m_draging(false)
|
m_dragging(false)
|
||||||
{
|
{
|
||||||
qDebug() << "load plugins item: " << pluginInter->pluginName() << itemKey << m_centralWidget;
|
qDebug() << "load plugins item: " << pluginInter->pluginName() << itemKey << m_centralWidget;
|
||||||
|
|
||||||
@ -153,7 +153,7 @@ void PluginsItem::mouseReleaseEvent(QMouseEvent *e)
|
|||||||
|
|
||||||
bool PluginsItem::eventFilter(QObject *o, QEvent *e)
|
bool PluginsItem::eventFilter(QObject *o, QEvent *e)
|
||||||
{
|
{
|
||||||
if (m_draging)
|
if (m_dragging)
|
||||||
if (o == m_centralWidget && e->type() == QEvent::Paint)
|
if (o == m_centralWidget && e->type() == QEvent::Paint)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@ -187,7 +187,7 @@ void PluginsItem::startDrag()
|
|||||||
{
|
{
|
||||||
const QPixmap pixmap = grab();
|
const QPixmap pixmap = grab();
|
||||||
|
|
||||||
m_draging = true;
|
m_dragging = true;
|
||||||
update();
|
update();
|
||||||
|
|
||||||
QMimeData *mime = new QMimeData;
|
QMimeData *mime = new QMimeData;
|
||||||
@ -203,7 +203,7 @@ void PluginsItem::startDrag()
|
|||||||
Q_UNUSED(result);
|
Q_UNUSED(result);
|
||||||
emit itemDropped(drag->target());
|
emit itemDropped(drag->target());
|
||||||
|
|
||||||
m_draging = false;
|
m_dragging = false;
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ private:
|
|||||||
PluginsItemInterface * const m_pluginInter;
|
PluginsItemInterface * const m_pluginInter;
|
||||||
QWidget *m_centralWidget;
|
QWidget *m_centralWidget;
|
||||||
const QString m_itemKey;
|
const QString m_itemKey;
|
||||||
bool m_draging;
|
bool m_dragging;
|
||||||
|
|
||||||
static QPoint MousePressPoint;
|
static QPoint MousePressPoint;
|
||||||
};
|
};
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#include <QBoxLayout>
|
#include <QBoxLayout>
|
||||||
#include <QDragEnterEvent>
|
#include <QDragEnterEvent>
|
||||||
|
|
||||||
DockItem *MainPanel::DragingItem = nullptr;
|
DockItem *MainPanel::DraggingItem = nullptr;
|
||||||
PlaceholderItem *MainPanel::RequestDockItem = nullptr;
|
PlaceholderItem *MainPanel::RequestDockItem = nullptr;
|
||||||
|
|
||||||
const char *RequestDockKey = "RequestDock";
|
const char *RequestDockKey = "RequestDock";
|
||||||
@ -197,11 +197,11 @@ void MainPanel::dragEnterEvent(QDragEnterEvent *e)
|
|||||||
if (dragSourceItem)
|
if (dragSourceItem)
|
||||||
{
|
{
|
||||||
e->accept();
|
e->accept();
|
||||||
if (DragingItem)
|
if (DraggingItem)
|
||||||
DragingItem->show();
|
DraggingItem->show();
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
DragingItem = nullptr;
|
DraggingItem = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!e->mimeData()->formats().contains(RequestDockKey))
|
if (!e->mimeData()->formats().contains(RequestDockKey))
|
||||||
@ -223,16 +223,16 @@ void MainPanel::dragMoveEvent(QDragMoveEvent *e)
|
|||||||
// internal drag swap
|
// internal drag swap
|
||||||
if (e->source())
|
if (e->source())
|
||||||
{
|
{
|
||||||
if (dst == DragingItem)
|
if (dst == DraggingItem)
|
||||||
return;
|
return;
|
||||||
if (!DragingItem)
|
if (!DraggingItem)
|
||||||
return;
|
return;
|
||||||
if (m_itemController->itemIsInContainer(DragingItem))
|
if (m_itemController->itemIsInContainer(DraggingItem))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_itemController->itemMove(DragingItem, dst);
|
m_itemController->itemMove(DraggingItem, dst);
|
||||||
} else {
|
} else {
|
||||||
DragingItem = nullptr;
|
DraggingItem = nullptr;
|
||||||
|
|
||||||
if (!RequestDockItem)
|
if (!RequestDockItem)
|
||||||
{
|
{
|
||||||
@ -270,15 +270,15 @@ void MainPanel::dragLeaveEvent(QDragLeaveEvent *e)
|
|||||||
RequestDockItem = nullptr;
|
RequestDockItem = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DragingItem && DragingItem->itemType() != DockItem::Plugins)
|
if (DraggingItem && DraggingItem->itemType() != DockItem::Plugins)
|
||||||
DragingItem->hide();
|
DraggingItem->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainPanel::dropEvent(QDropEvent *e)
|
void MainPanel::dropEvent(QDropEvent *e)
|
||||||
{
|
{
|
||||||
Q_UNUSED(e)
|
Q_UNUSED(e)
|
||||||
|
|
||||||
DragingItem = nullptr;
|
DraggingItem = nullptr;
|
||||||
|
|
||||||
if (RequestDockItem)
|
if (RequestDockItem)
|
||||||
{
|
{
|
||||||
@ -546,17 +546,17 @@ void MainPanel::itemMoved(DockItem *item, const int index)
|
|||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
/// \brief MainPanel::itemDragStarted handle managed item draging
|
/// \brief MainPanel::itemDragStarted handle managed item dragging
|
||||||
///
|
///
|
||||||
void MainPanel::itemDragStarted()
|
void MainPanel::itemDragStarted()
|
||||||
{
|
{
|
||||||
DragingItem = qobject_cast<DockItem *>(sender());
|
DraggingItem = qobject_cast<DockItem *>(sender());
|
||||||
|
|
||||||
if (DragingItem->itemType() == DockItem::Plugins)
|
if (DraggingItem->itemType() == DockItem::Plugins)
|
||||||
{
|
{
|
||||||
if (static_cast<PluginsItem *>(DragingItem)->allowContainer())
|
if (static_cast<PluginsItem *>(DraggingItem)->allowContainer())
|
||||||
{
|
{
|
||||||
qobject_cast<PluginsItem *>(DragingItem)->hidePopup();
|
qobject_cast<PluginsItem *>(DraggingItem)->hidePopup();
|
||||||
m_itemController->setDropping(true);
|
m_itemController->setDropping(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -565,7 +565,7 @@ void MainPanel::itemDragStarted()
|
|||||||
rect.setTopLeft(mapToGlobal(pos()));
|
rect.setTopLeft(mapToGlobal(pos()));
|
||||||
rect.setSize(size());
|
rect.setSize(size());
|
||||||
|
|
||||||
DragingItem->setVisible(rect.contains(QCursor::pos()));
|
DraggingItem->setVisible(rect.contains(QCursor::pos()));
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
|
@ -89,7 +89,7 @@ private:
|
|||||||
QTimer *m_itemAdjustTimer;
|
QTimer *m_itemAdjustTimer;
|
||||||
DockItemController *m_itemController;
|
DockItemController *m_itemController;
|
||||||
|
|
||||||
static DockItem *DragingItem;
|
static DockItem *DraggingItem;
|
||||||
static PlaceholderItem *RequestDockItem;
|
static PlaceholderItem *RequestDockItem;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user