mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
fix: 修复隐藏启动器图标固定区域全部消失的问题
之前的代码有问题,看了下,删除之前开发的提交即可 Log: 修复隐藏启动器图标固定区域全部消失的问题 Bug: https://pms.uniontech.com/zentao/bug-view-66381.html Change-Id: I2e96407e9d2963dcfd3e9a0d32a6c123991d0222
This commit is contained in:
parent
82f71facef
commit
21c97d420b
@ -49,11 +49,6 @@
|
||||
|
||||
DWIDGET_USE_NAMESPACE
|
||||
|
||||
static QGSettings *GSettingsByLaunch()
|
||||
{
|
||||
static QGSettings settings("com.deepin.dde.dock.module.launcher");
|
||||
return &settings;
|
||||
}
|
||||
|
||||
static QGSettings *GSettingsByApp()
|
||||
{
|
||||
@ -83,7 +78,6 @@ MainPanelControl::MainPanelControl(QWidget *parent)
|
||||
, m_dislayMode(Efficient)
|
||||
, m_isHover(false)
|
||||
, m_needRecoveryWin(false)
|
||||
, m_isEnableLaunch(true)
|
||||
{
|
||||
initUi();
|
||||
updateMainPanelLayout();
|
||||
@ -156,30 +150,6 @@ void MainPanelControl::initUi()
|
||||
m_mainPanelLayout->setAlignment(m_fixedSpliter, Qt::AlignCenter);
|
||||
m_mainPanelLayout->setAlignment(m_appSpliter, Qt::AlignCenter);
|
||||
m_mainPanelLayout->setAlignment(m_traySpliter, Qt::AlignCenter);
|
||||
|
||||
connect(GSettingsByLaunch(), &QGSettings::changed, this, &MainPanelControl::onGSettingsChanged);
|
||||
}
|
||||
|
||||
void MainPanelControl::onGSettingsChanged(const QString &key)
|
||||
{
|
||||
if (key != "enable") {
|
||||
return;
|
||||
}
|
||||
|
||||
QGSettings *setting = GSettingsByLaunch();
|
||||
|
||||
if (setting->keys().contains("enable")) {
|
||||
const bool isEnable = GSettingsByLaunch()->keys().contains("enable") && GSettingsByLaunch()->get("enable").toBool();
|
||||
if (isEnable && setting->get("enable").toBool()) {
|
||||
m_fixedAreaWidget->setVisible(true);
|
||||
m_fixedSpliter->setVisible(true);
|
||||
m_isEnableLaunch = true;
|
||||
} else {
|
||||
m_fixedAreaWidget->setVisible(false);
|
||||
m_fixedSpliter->setVisible(false);
|
||||
m_isEnableLaunch = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MainPanelControl::setDisplayMode(DisplayMode dislayMode)
|
||||
@ -897,15 +867,6 @@ void MainPanelControl::itemUpdated(DockItem *item)
|
||||
resizeDockIcon();
|
||||
}
|
||||
|
||||
void MainPanelControl::showEvent(QShowEvent *event)
|
||||
{
|
||||
QTimer::singleShot(0, this, [ = ] {
|
||||
onGSettingsChanged("enable");
|
||||
});
|
||||
|
||||
return QWidget::showEvent(event);
|
||||
}
|
||||
|
||||
void MainPanelControl::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
@ -920,8 +881,7 @@ void MainPanelControl::paintEvent(QPaintEvent *event)
|
||||
painter.setOpacity(0.1);
|
||||
}
|
||||
|
||||
if (m_isEnableLaunch)
|
||||
painter.fillRect(m_fixedSpliter->geometry(), color);
|
||||
painter.fillRect(m_fixedSpliter->geometry(), color);
|
||||
painter.fillRect(m_appSpliter->geometry(), color);
|
||||
painter.fillRect(m_traySpliter->geometry(), color);
|
||||
|
||||
|
@ -75,14 +75,11 @@ public slots:
|
||||
void removeItem(DockItem *item);
|
||||
void itemUpdated(DockItem *item);
|
||||
|
||||
void onGSettingsChanged(const QString &key);
|
||||
|
||||
signals:
|
||||
void itemMoved(DockItem *sourceItem, DockItem *targetItem);
|
||||
void itemAdded(const QString &appDesktop, int idx);
|
||||
|
||||
protected:
|
||||
void showEvent(QShowEvent *event) override;
|
||||
void dragMoveEvent(QDragMoveEvent *e) override;
|
||||
void dragEnterEvent(QDragEnterEvent *e) override;
|
||||
void dragLeaveEvent(QDragLeaveEvent *e) override;
|
||||
@ -145,7 +142,6 @@ private:
|
||||
TrayPluginItem *m_tray = nullptr;
|
||||
bool m_isHover; // 判断鼠标是否移到desktop区域
|
||||
bool m_needRecoveryWin; // 判断鼠标移出desktop区域是否恢复之前窗口
|
||||
bool m_isEnableLaunch; // 判断是否使能了com.deepin.dde.dock.module.launcher
|
||||
int m_dragIndex = -1; // 记录应用区域被拖拽图标的位置
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user