mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-03 00:15:21 +00:00
feat(dock): optimizing code
This commit is contained in:
parent
391ef1005e
commit
682ad36c6c
@ -55,9 +55,6 @@ MainPanelControl::MainPanelControl(QWidget *parent)
|
||||
setAcceptDrops(true);
|
||||
setMouseTracking(true);
|
||||
|
||||
connect(this, SIGNAL(displayModeChanged()), this, SLOT(onDisplayModeChanged()));
|
||||
connect(this, SIGNAL(positionChanged()), this, SLOT(onPositionChanged()));
|
||||
|
||||
m_appAreaWidget->installEventFilter(this);
|
||||
m_appAreaSonWidget->installEventFilter(this);
|
||||
}
|
||||
@ -108,7 +105,7 @@ void MainPanelControl::setDisplayMode(DisplayMode mode)
|
||||
if (mode == m_dislayMode)
|
||||
return;
|
||||
m_dislayMode = mode;
|
||||
emit displayModeChanged();
|
||||
updateDisplayMode();
|
||||
}
|
||||
|
||||
void MainPanelControl::updateMainPanelLayout()
|
||||
@ -372,7 +369,6 @@ void MainPanelControl::dragLeaveEvent(QDragLeaveEvent *e)
|
||||
|
||||
removeAppAreaItem(m_placeholderItem);
|
||||
m_placeholderItem->deleteLater();
|
||||
updateMainPanelLayout();
|
||||
}
|
||||
}
|
||||
|
||||
@ -674,12 +670,7 @@ void MainPanelControl::moveAppSonWidget()
|
||||
m_appAreaSonWidget->move(rect.x(), rect.y());
|
||||
}
|
||||
|
||||
void MainPanelControl::onDisplayModeChanged()
|
||||
{
|
||||
updateDisplayMode();
|
||||
}
|
||||
|
||||
void MainPanelControl::onPositionChanged()
|
||||
void MainPanelControl::positionChanged()
|
||||
{
|
||||
updateMainPanelLayout();
|
||||
}
|
||||
|
@ -55,6 +55,7 @@ public:
|
||||
void removePluginAreaItem(QWidget *wdg);
|
||||
void setPositonValue(Position position);
|
||||
void setDisplayMode(DisplayMode m_displayMode);
|
||||
void positionChanged();
|
||||
|
||||
MainPanelDelegate *delegate() const;
|
||||
void setDelegate(MainPanelDelegate *delegate);
|
||||
@ -62,8 +63,6 @@ public:
|
||||
signals:
|
||||
void itemMoved(DockItem *sourceItem, DockItem *targetItem);
|
||||
void itemAdded(const QString &appDesktop, int idx);
|
||||
void displayModeChanged();
|
||||
void positionChanged();
|
||||
|
||||
private:
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
@ -88,8 +87,6 @@ private:
|
||||
public slots:
|
||||
void insertItem(const int index, DockItem *item);
|
||||
void removeItem(DockItem *item);
|
||||
void onDisplayModeChanged();
|
||||
void onPositionChanged();
|
||||
void itemUpdated(DockItem *item);
|
||||
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user