forked from openkylin/ukui-panel
fix(panel): 添加显示桌面和设置任务栏选项
This commit is contained in:
parent
e38d1767e1
commit
0529073f81
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -53,7 +53,8 @@ QWidget *PanelUkccPlugin::pluginUi()
|
|||
|
||||
const QString PanelUkccPlugin::name() const
|
||||
{
|
||||
return tr("Panel");
|
||||
// 不需要翻译,作为key,用于在控制面板激活并显示插件
|
||||
return "Panel";
|
||||
}
|
||||
|
||||
QString PanelUkccPlugin::translationPath() const
|
||||
|
|
Loading…
Reference in New Issue