mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-03 00:15:21 +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_itemScene(new QGraphicsScene(this)),
|
||||
|
||||
m_draging(false),
|
||||
m_dragging(false),
|
||||
|
||||
m_appIcon(QPixmap()),
|
||||
|
||||
@ -237,7 +237,7 @@ void AppItem::paintEvent(QPaintEvent *e)
|
||||
{
|
||||
DockItem::paintEvent(e);
|
||||
|
||||
if (m_draging || (m_swingEffectView->isVisible() && DockDisplayMode != Fashion))
|
||||
if (m_dragging || (m_swingEffectView->isVisible() && DockDisplayMode != Fashion))
|
||||
return;
|
||||
|
||||
QPainter painter(this);
|
||||
@ -471,7 +471,7 @@ const QString AppItem::contextMenu() const
|
||||
|
||||
QWidget *AppItem::popupTips()
|
||||
{
|
||||
if (m_draging)
|
||||
if (m_dragging)
|
||||
return nullptr;
|
||||
|
||||
if (!m_windowInfos.isEmpty())
|
||||
@ -488,7 +488,7 @@ QWidget *AppItem::popupTips()
|
||||
|
||||
void AppItem::startDrag()
|
||||
{
|
||||
m_draging = true;
|
||||
m_dragging = true;
|
||||
update();
|
||||
|
||||
const QPixmap &dragPix = m_appIcon;
|
||||
@ -506,7 +506,7 @@ void AppItem::startDrag()
|
||||
if (!drag->target())
|
||||
m_itemEntryInter->RequestUndock();
|
||||
|
||||
m_draging = false;
|
||||
m_dragging = false;
|
||||
setVisible(true);
|
||||
update();
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ private:
|
||||
QGraphicsScene *m_itemScene;
|
||||
QGraphicsItemAnimation m_itemAnimation;
|
||||
|
||||
bool m_draging;
|
||||
bool m_dragging;
|
||||
bool m_active;
|
||||
WindowInfoMap m_windowInfos;
|
||||
QString m_id;
|
||||
|
@ -40,7 +40,7 @@ PluginsItem::PluginsItem(PluginsItemInterface* const pluginInter, const QString
|
||||
m_pluginInter(pluginInter),
|
||||
m_centralWidget(m_pluginInter->itemWidget(itemKey)),
|
||||
m_itemKey(itemKey),
|
||||
m_draging(false)
|
||||
m_dragging(false)
|
||||
{
|
||||
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)
|
||||
{
|
||||
if (m_draging)
|
||||
if (m_dragging)
|
||||
if (o == m_centralWidget && e->type() == QEvent::Paint)
|
||||
return true;
|
||||
|
||||
@ -187,7 +187,7 @@ void PluginsItem::startDrag()
|
||||
{
|
||||
const QPixmap pixmap = grab();
|
||||
|
||||
m_draging = true;
|
||||
m_dragging = true;
|
||||
update();
|
||||
|
||||
QMimeData *mime = new QMimeData;
|
||||
@ -203,7 +203,7 @@ void PluginsItem::startDrag()
|
||||
Q_UNUSED(result);
|
||||
emit itemDropped(drag->target());
|
||||
|
||||
m_draging = false;
|
||||
m_dragging = false;
|
||||
setVisible(true);
|
||||
update();
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ private:
|
||||
PluginsItemInterface * const m_pluginInter;
|
||||
QWidget *m_centralWidget;
|
||||
const QString m_itemKey;
|
||||
bool m_draging;
|
||||
bool m_dragging;
|
||||
|
||||
static QPoint MousePressPoint;
|
||||
};
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include <QBoxLayout>
|
||||
#include <QDragEnterEvent>
|
||||
|
||||
DockItem *MainPanel::DragingItem = nullptr;
|
||||
DockItem *MainPanel::DraggingItem = nullptr;
|
||||
PlaceholderItem *MainPanel::RequestDockItem = nullptr;
|
||||
|
||||
const char *RequestDockKey = "RequestDock";
|
||||
@ -197,11 +197,11 @@ void MainPanel::dragEnterEvent(QDragEnterEvent *e)
|
||||
if (dragSourceItem)
|
||||
{
|
||||
e->accept();
|
||||
if (DragingItem)
|
||||
DragingItem->show();
|
||||
if (DraggingItem)
|
||||
DraggingItem->show();
|
||||
return;
|
||||
} else {
|
||||
DragingItem = nullptr;
|
||||
DraggingItem = nullptr;
|
||||
}
|
||||
|
||||
if (!e->mimeData()->formats().contains(RequestDockKey))
|
||||
@ -223,16 +223,16 @@ void MainPanel::dragMoveEvent(QDragMoveEvent *e)
|
||||
// internal drag swap
|
||||
if (e->source())
|
||||
{
|
||||
if (dst == DragingItem)
|
||||
if (dst == DraggingItem)
|
||||
return;
|
||||
if (!DragingItem)
|
||||
if (!DraggingItem)
|
||||
return;
|
||||
if (m_itemController->itemIsInContainer(DragingItem))
|
||||
if (m_itemController->itemIsInContainer(DraggingItem))
|
||||
return;
|
||||
|
||||
m_itemController->itemMove(DragingItem, dst);
|
||||
m_itemController->itemMove(DraggingItem, dst);
|
||||
} else {
|
||||
DragingItem = nullptr;
|
||||
DraggingItem = nullptr;
|
||||
|
||||
if (!RequestDockItem)
|
||||
{
|
||||
@ -270,15 +270,15 @@ void MainPanel::dragLeaveEvent(QDragLeaveEvent *e)
|
||||
RequestDockItem = nullptr;
|
||||
}
|
||||
|
||||
if (DragingItem && DragingItem->itemType() != DockItem::Plugins)
|
||||
DragingItem->hide();
|
||||
if (DraggingItem && DraggingItem->itemType() != DockItem::Plugins)
|
||||
DraggingItem->hide();
|
||||
}
|
||||
|
||||
void MainPanel::dropEvent(QDropEvent *e)
|
||||
{
|
||||
Q_UNUSED(e)
|
||||
|
||||
DragingItem = nullptr;
|
||||
DraggingItem = nullptr;
|
||||
|
||||
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()
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
@ -565,7 +565,7 @@ void MainPanel::itemDragStarted()
|
||||
rect.setTopLeft(mapToGlobal(pos()));
|
||||
rect.setSize(size());
|
||||
|
||||
DragingItem->setVisible(rect.contains(QCursor::pos()));
|
||||
DraggingItem->setVisible(rect.contains(QCursor::pos()));
|
||||
}
|
||||
|
||||
///
|
||||
|
@ -89,7 +89,7 @@ private:
|
||||
QTimer *m_itemAdjustTimer;
|
||||
DockItemController *m_itemController;
|
||||
|
||||
static DockItem *DragingItem;
|
||||
static DockItem *DraggingItem;
|
||||
static PlaceholderItem *RequestDockItem;
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user