mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-02 15:45:21 +00:00
feat: 增加一直隐藏任务栏配置
增加彻底隐藏任务栏的配置 Log: 支持任务栏彻底隐藏 Task: https://pms.uniontech.com/task-view-113997.html Influence: 任务栏隐藏和显示 Change-Id: I79412029758e38f56719bd03302cb667506f531e
This commit is contained in:
parent
44ab6359d5
commit
7f9088ba83
@ -15,6 +15,17 @@
|
||||
"description":"0 Mouse over show;1 Always show; 2 Always hide",
|
||||
"permissions":"readwrite",
|
||||
"visibility":"private"
|
||||
},
|
||||
"alwaysHideDock":{
|
||||
"value": false,
|
||||
"serial": 0,
|
||||
"flags":[],
|
||||
"name":"alwaysHideDock",
|
||||
"name[zh_CN]":"一直隐藏",
|
||||
"description[zh_CN]":"当设置为true时,即使鼠标放在任务栏区域也不会显示任务栏;配置即时生效",
|
||||
"description":"ture: Dock is hidden all the time, false: Depend on other settings of dock",
|
||||
"permissions":"readwrite",
|
||||
"visibility":"private"
|
||||
}
|
||||
}
|
||||
}
|
@ -36,6 +36,7 @@
|
||||
#include <DApplication>
|
||||
#include <DLog>
|
||||
#include <DGuiApplicationHelper>
|
||||
#include <DConfig>
|
||||
|
||||
#include <unistd.h>
|
||||
#include <string>
|
||||
|
@ -90,6 +90,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
, m_dragWidget(new DragWidget(this))
|
||||
, m_launched(false)
|
||||
, m_updateDragAreaTimer(new QTimer(this))
|
||||
, m_dconfig(DConfig::create("org.deepin.dde.dock", "org.deepin.dde.dock", QString(), this))
|
||||
{
|
||||
setAttribute(Qt::WA_TranslucentBackground);
|
||||
setAttribute(Qt::WA_X11DoNotAcceptFocus);
|
||||
@ -156,7 +157,12 @@ void MainWindow::launch()
|
||||
m_launched = true;
|
||||
m_multiScreenWorker->initShow();
|
||||
m_shadowMaskOptimizeTimer->start();
|
||||
QTimer::singleShot(0, this, [ this ] { this->setVisible(true); });
|
||||
QTimer::singleShot(0, this, [ this ] {
|
||||
bool showDock = true;
|
||||
if (m_dconfig.data()->isValid())
|
||||
showDock = !m_dconfig.data()->value("alwaysHideDock", false).toBool();
|
||||
setVisible(showDock);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -298,6 +304,14 @@ void MainWindow::initComponents()
|
||||
QTimer::singleShot(1, this, &MainWindow::compositeChanged);
|
||||
|
||||
themeTypeChanged(DGuiApplicationHelper::instance()->themeType());
|
||||
|
||||
if (m_dconfig.data()->isValid()) {
|
||||
connect(m_dconfig.data(), &DConfig::valueChanged, this, [this] (const QString &key) {
|
||||
if (key == "alwaysHideDock") {
|
||||
setVisible(!m_dconfig.data()->value(key, false).toBool());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::compositeChanged()
|
||||
|
@ -35,10 +35,12 @@
|
||||
#include <DWindowManagerHelper>
|
||||
#include <DBlurEffectWidget>
|
||||
#include <DGuiApplicationHelper>
|
||||
#include <DConfig>
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
DWIDGET_USE_NAMESPACE
|
||||
DCORE_USE_NAMESPACE
|
||||
|
||||
class MainPanelControl;
|
||||
class QTimer;
|
||||
@ -226,6 +228,7 @@ private:
|
||||
QStringList m_registerKeys;
|
||||
|
||||
QTimer *m_updateDragAreaTimer;
|
||||
QSharedPointer<DConfig> m_dconfig;
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user