global shortcuts and different flags for the dashboard

it should be actually usable
This commit is contained in:
Marco Martin 2014-02-14 13:56:13 +01:00
parent 44ab365d2c
commit ad54cc0187
3 changed files with 9 additions and 3 deletions

View File

@ -65,6 +65,7 @@ target_link_libraries(plasma-shell
KF5::XmlGui
KF5::IconThemes
KF5::Activities
KF5::GlobalAccel
)
target_include_directories(plasma-shell PRIVATE "${CMAKE_BINARY_DIR}")

View File

@ -93,10 +93,12 @@ void DesktopView::setDashboardShown(bool shown)
if (shown) {
if (m_stayBehind) {
KWindowSystem::setType(winId(), NET::Normal);
KWindowSystem::clearState(winId(), NET::SkipTaskbar|NET::KeepBelow);
}
raise();
KWindowSystem::raiseWindow(winId());
KWindowSystem::forceActiveWindow(winId());
QObject *wpGraphicObject = containment()->property("wallpaperGraphicsObject").value<QObject *>();
if (wpGraphicObject) {
wpGraphicObject->setProperty("opacity", 0.3);
@ -104,6 +106,7 @@ void DesktopView::setDashboardShown(bool shown)
} else {
if (m_stayBehind) {
KWindowSystem::setType(winId(), NET::Desktop);
KWindowSystem::setState(winId(), NET::SkipTaskbar|NET::SkipPager|NET::KeepBelow);
}
lower();
KWindowSystem::lowerWindow(winId());

View File

@ -36,6 +36,7 @@
#include <kactivities/consumer.h>
#include <ksycoca.h>
#include <kservicetypetrader.h>
#include <KGlobalAccel>
#include "activity.h"
@ -140,12 +141,13 @@ ShellCorona::ShellCorona(QObject *parent)
QObject::connect(dashboardAction, &QAction::triggered,
this, &ShellCorona::setDashboardShown);
dashboardAction->setText(i18n("Show Dashboard"));
dashboardAction->setAutoRepeat(true);
dashboardAction->setCheckable(true);
dashboardAction->setIcon(QIcon::fromTheme("dashboard-show"));
dashboardAction->setData(Plasma::Types::ControlAction);
dashboardAction->setShortcut(QKeySequence("ctrl+f12"));
dashboardAction->setShortcutContext(Qt::ApplicationShortcut);
KGlobalAccel::self()->setDefaultShortcut(dashboardAction, QList<QKeySequence>() << QKeySequence(Qt::Key_Control + Qt::Key_F12));
KGlobalAccel::self()->setShortcut(dashboardAction, QList<QKeySequence>() << QKeySequence(Qt::Key_Control + Qt::Key_F12));
checkAddPanelAction();