mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 09:23:03 +00:00
fix: 修复文案显示错误
1、将原来的使用电源修改为电源 2、删除禁用和启动插件接口的响应 3、根据需求,电池不在控制中心显示 Log: 修复文案显示错误 Influence: 任务栏最右侧的电源按钮 Bug: https://pms.uniontech.com/bug-view-180959.html Change-Id: I483619382bf59187c03dae25a1885d59bb5b865a
This commit is contained in:
parent
17c2ba71f0
commit
d736fd0b49
@ -153,11 +153,11 @@ QIcon PowerPlugin::icon(const DockPart &dockPart, DGuiApplicationHelper::ColorTy
|
|||||||
|
|
||||||
PluginFlags PowerPlugin::flags() const
|
PluginFlags PowerPlugin::flags() const
|
||||||
{
|
{
|
||||||
// 电池插件只在任务栏上面展示,不在快捷面板展示,并且可以拖动,可以在其前面插入其他插件,可以在控制中心设置是否显示隐藏
|
// 电池插件只在任务栏上面展示,不在快捷面板展示,并且可以拖动,可以在其前面插入其他插件,不能在控制中心设置是否显示隐藏
|
||||||
return PluginFlag::Type_Common
|
return PluginFlag::Type_Common
|
||||||
| PluginFlag::Attribute_CanDrag
|
| PluginFlag::Attribute_CanDrag
|
||||||
| PluginFlag::Attribute_CanInsert
|
| PluginFlag::Attribute_CanInsert
|
||||||
| PluginFlag::Attribute_CanSetting;
|
| PluginFlag::Attribute_ForceDock;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PowerPlugin::updateBatteryVisible()
|
void PowerPlugin::updateBatteryVisible()
|
||||||
|
@ -63,7 +63,7 @@ const QString ShutdownPlugin::pluginName() const
|
|||||||
|
|
||||||
const QString ShutdownPlugin::pluginDisplayName() const
|
const QString ShutdownPlugin::pluginDisplayName() const
|
||||||
{
|
{
|
||||||
return tr("Plugged In");
|
return tr("Power");
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *ShutdownPlugin::itemWidget(const QString &itemKey)
|
QWidget *ShutdownPlugin::itemWidget(const QString &itemKey)
|
||||||
@ -79,7 +79,7 @@ QWidget *ShutdownPlugin::itemTipsWidget(const QString &itemKey)
|
|||||||
|
|
||||||
// reset text every time to avoid size of LabelWidget not change after
|
// reset text every time to avoid size of LabelWidget not change after
|
||||||
// font size be changed in ControlCenter
|
// font size be changed in ControlCenter
|
||||||
m_tipsLabel->setText(tr("Plugged In"));
|
m_tipsLabel->setText(tr("Power"));
|
||||||
|
|
||||||
return m_tipsLabel.data();
|
return m_tipsLabel.data();
|
||||||
}
|
}
|
||||||
@ -102,8 +102,6 @@ void ShutdownPlugin::init(PluginProxyInterface *proxyInter)
|
|||||||
void ShutdownPlugin::pluginStateSwitched()
|
void ShutdownPlugin::pluginStateSwitched()
|
||||||
{
|
{
|
||||||
m_proxyInter->saveValue(this, PLUGIN_STATE_KEY, !m_proxyInter->getValue(this, PLUGIN_STATE_KEY, true).toBool());
|
m_proxyInter->saveValue(this, PLUGIN_STATE_KEY, !m_proxyInter->getValue(this, PLUGIN_STATE_KEY, true).toBool());
|
||||||
|
|
||||||
refreshPluginItemsVisible();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ShutdownPlugin::pluginIsDisable()
|
bool ShutdownPlugin::pluginIsDisable()
|
||||||
@ -290,11 +288,6 @@ void ShutdownPlugin::setSortKey(const QString &itemKey, const int order)
|
|||||||
m_proxyInter->saveValue(this, key, order);
|
m_proxyInter->saveValue(this, key, order);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShutdownPlugin::pluginSettingsChanged()
|
|
||||||
{
|
|
||||||
refreshPluginItemsVisible();
|
|
||||||
}
|
|
||||||
|
|
||||||
QIcon ShutdownPlugin::icon(const DockPart &dockPart, DGuiApplicationHelper::ColorType themeType)
|
QIcon ShutdownPlugin::icon(const DockPart &dockPart, DGuiApplicationHelper::ColorType themeType)
|
||||||
{
|
{
|
||||||
if (dockPart == DockPart::DCCSetting) {
|
if (dockPart == DockPart::DCCSetting) {
|
||||||
@ -402,16 +395,3 @@ bool ShutdownPlugin::checkSwap()
|
|||||||
|
|
||||||
return hasSwap;
|
return hasSwap;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShutdownPlugin::refreshPluginItemsVisible()
|
|
||||||
{
|
|
||||||
if (pluginIsDisable()) {
|
|
||||||
m_proxyInter->itemRemoved(this, pluginName());
|
|
||||||
} else {
|
|
||||||
if (!m_pluginLoaded) {
|
|
||||||
loadPlugin();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
m_proxyInter->itemAdded(this, pluginName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -60,7 +60,6 @@ public:
|
|||||||
int itemSortKey(const QString &itemKey) override;
|
int itemSortKey(const QString &itemKey) override;
|
||||||
void setSortKey(const QString &itemKey, const int order) override;
|
void setSortKey(const QString &itemKey, const int order) override;
|
||||||
|
|
||||||
void pluginSettingsChanged() override;
|
|
||||||
QIcon icon(const DockPart &dockPart, DGuiApplicationHelper::ColorType themeType) override;
|
QIcon icon(const DockPart &dockPart, DGuiApplicationHelper::ColorType themeType) override;
|
||||||
PluginFlags flags() const override;
|
PluginFlags flags() const override;
|
||||||
|
|
||||||
@ -108,7 +107,6 @@ public:
|
|||||||
private:
|
private:
|
||||||
void loadPlugin();
|
void loadPlugin();
|
||||||
bool checkSwap();
|
bool checkSwap();
|
||||||
void refreshPluginItemsVisible();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_pluginLoaded;
|
bool m_pluginLoaded;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user