Add shortcuts to lower/raise opacity

REVIEW: 102374
This commit is contained in:
Martin Gräßlin 2011-08-19 21:53:30 +02:00
parent 6e15c0c208
commit 2f3c383ecd
3 changed files with 23 additions and 0 deletions

View file

@ -137,6 +137,10 @@ DEF2("Switch Window Right", I18N_NOOP("Switch to Window to the Right"),
Qt::META + Qt::ALT + Qt::Key_Right, slotSwitchWindowRight());
DEF2("Switch Window Left", I18N_NOOP("Switch to Window to the Left"),
Qt::META + Qt::ALT + Qt::Key_Left, slotSwitchWindowLeft());
DEF2("Increase Opacity", I18N_NOOP("Increase Opacity of Active Window by 5 %"),
0, slotIncreaseWindowOpacity());
DEF2("Decrease Opacity", I18N_NOOP("Decrease Opacity of Active Window by 5 %"),
0, slotLowerWindowOpacity());
a = actionCollection->addAction("Group:Window Desktop");
a->setText(i18n("Window & Desktop"));

View file

@ -254,6 +254,22 @@ void Workspace::setPopupClientOpacity(QAction* action)
active_popup_client->setOpacity(level / 100.0);
}
void Workspace::slotIncreaseWindowOpacity()
{
if (!active_client) {
return;
}
active_client->setOpacity(qMin(active_client->opacity() + 0.05, 1.0));
}
void Workspace::slotLowerWindowOpacity()
{
if (!active_client) {
return;
}
active_client->setOpacity(qMax(active_client->opacity() - 0.05, 0.05));
}
/*!
The client popup menu will become visible soon.

View file

@ -582,6 +582,9 @@ public slots:
void slotSwitchWindowRight();
void slotSwitchWindowLeft();
void slotIncreaseWindowOpacity();
void slotLowerWindowOpacity();
void slotWindowOperations();
void slotWindowClose();
void slotWindowMove();