|
|
|
|
@ -167,6 +167,8 @@ ShellCorona::ShellCorona(QObject *parent) |
|
|
|
|
connect(this, &ShellCorona::containmentAdded, |
|
|
|
|
this, &ShellCorona::handleContainmentAdded); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QAction *dashboardAction = actions()->addAction(QStringLiteral("show dashboard")); |
|
|
|
|
QObject::connect(dashboardAction, &QAction::triggered, |
|
|
|
|
this, &ShellCorona::setDashboardShown); |
|
|
|
|
@ -182,6 +184,21 @@ ShellCorona::ShellCorona(QObject *parent) |
|
|
|
|
dashboardAction->setData(Plasma::Types::ControlAction); |
|
|
|
|
KGlobalAccel::self()->setGlobalShortcut(dashboardAction, Qt::CTRL + Qt::Key_F12); |
|
|
|
|
|
|
|
|
|
QAction *panelAction = actions()->addAction(QStringLiteral("show panel")); |
|
|
|
|
QObject::connect(panelAction, &QAction::triggered, |
|
|
|
|
this, &ShellCorona::togglePanelVisibility); |
|
|
|
|
panelAction->setText(i18n("Toggle Panel")); |
|
|
|
|
// connect(KWindowSystem::self(), &KWindowSystem::showingDesktopChanged, [panelAction](bool showing) {
|
|
|
|
|
// panelAction->setText(showing ? i18n("Hide Desktop") : i18n("Show Desktop"));
|
|
|
|
|
// panelAction->setChecked(showing);
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
// panelAction->setAutoRepeat(true);
|
|
|
|
|
// panelAction->setCheckable(true);
|
|
|
|
|
// panelAction->setIcon(QIcon::fromTheme(QStringLiteral("panel-show")));
|
|
|
|
|
// panelAction->setData(Plasma::Types::ControlAction);
|
|
|
|
|
KGlobalAccel::self()->setGlobalShortcut(panelAction, Qt::CTRL + Qt::Key_F11); |
|
|
|
|
|
|
|
|
|
checkAddPanelAction(); |
|
|
|
|
connect(KSycoca::self(), SIGNAL(databaseChanged(QStringList)), this, SLOT(checkAddPanelAction(QStringList))); |
|
|
|
|
|
|
|
|
|
@ -1177,6 +1194,16 @@ QList<PanelView *> ShellCorona::panelsForScreen(QScreen *screen) const |
|
|
|
|
return ret; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void ShellCorona::togglePanelVisibility() |
|
|
|
|
{ |
|
|
|
|
for (auto it = m_panelViews.constBegin(), end = m_panelViews.constEnd(); it != end; ++it) { |
|
|
|
|
if (it.value()->screen() != qGuiApp->primaryScreen()) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
it.value()->setVisible(!it.value()->isVisible()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
DesktopView* ShellCorona::desktopForScreen(QScreen* screen) const |
|
|
|
|
{ |
|
|
|
|
return m_desktopViewforId.value(m_screenPool->id(screen->name())); |
|
|
|
|
@ -2222,4 +2249,3 @@ void ShellCorona::activateTaskManagerEntry(int index) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "moc_shellcorona.cpp" |
|
|
|
|
|
|
|
|
|
|