fix(panel): 添加显示桌面和设置任务栏选项

This commit is contained in:
hewenfei 2024-04-25 14:27:29 +08:00 committed by He Sir
parent e38d1767e1
commit 0529073f81
3 changed files with 22 additions and 1 deletions

View File

@ -562,6 +562,12 @@ void Panel::loadActions()
separator->setSeparator(true);
actions << separator;
auto showDesktop = new QAction(tr("Show Desktop"), this);
connect(showDesktop, &QAction::triggered, this, [] {
KWindowSystem::setShowingDesktop(!KWindowSystem::showingDesktop());
});
actions << showDesktop;
auto systemMonitor = new QAction(tr("System Monitor"), this);
connect(systemMonitor, &QAction::triggered, this, [] {
UkuiQuick::AppLauncher::instance()->launchApp(QStringLiteral("/usr/share/applications/ukui-system-monitor.desktop"));
@ -593,6 +599,12 @@ void Panel::loadActions()
actions << m_autoHideAction;
auto panelSetting = new QAction(tr("Panel Setting"), this);
connect(panelSetting, &QAction::triggered, this, [] {
UkuiQuick::AppLauncher::instance()->launchAppWithArguments(QStringLiteral("/usr/share/applications/ukui-control-center.desktop"), {"-m", "Panel"});
});
actions << panelSetting;
m_container->setActions(actions);
}

View File

@ -55,5 +55,13 @@
<source>System Monitor</source>
<translation></translation>
</message>
<message>
<source>Show Desktop</source>
<translation></translation>
</message>
<message>
<source>Panel Setting</source>
<translation></translation>
</message>
</context>
</TS>

View File

@ -53,7 +53,8 @@ QWidget *PanelUkccPlugin::pluginUi()
const QString PanelUkccPlugin::name() const
{
return tr("Panel");
// 不需要翻译作为key用于在控制面板激活并显示插件
return "Panel";
}
QString PanelUkccPlugin::translationPath() const