Drop the opacity menu in KWin useractions menu (Alt+F3)
See discussion on mailinglist: http://lists.kde.org/?l=kwin&m=131368803718693&w=2 REVIEW: 102376
This commit is contained in:
parent
2f3c383ecd
commit
cdfd98e926
3 changed files with 2 additions and 42 deletions
|
@ -124,25 +124,6 @@ QMenu* Workspace::clientPopup()
|
|||
action->setIcon(KIcon("preferences-system-windows-actions"));
|
||||
action->setData(Options::ApplicationRulesOp);
|
||||
|
||||
trans_popup = 0;
|
||||
if (compositing()) {
|
||||
trans_popup = new QMenu(popup);
|
||||
trans_popup->setFont(KGlobalSettings::menuFont());
|
||||
connect(trans_popup, SIGNAL(triggered(QAction*)), this, SLOT(setPopupClientOpacity(QAction*)));
|
||||
trans_popup_group = new QActionGroup(trans_popup);
|
||||
const int levels[] = { 100, 90, 75, 50, 25, 10 };
|
||||
for (unsigned int i = 0;
|
||||
i < sizeof(levels) / sizeof(levels[ 0 ]);
|
||||
++i) {
|
||||
action = trans_popup->addAction(QString::number(levels[ i ]) + "%");
|
||||
action->setActionGroup(trans_popup_group);
|
||||
action->setCheckable(true);
|
||||
action->setData(levels[ i ]);
|
||||
}
|
||||
action = popup->addMenu(trans_popup);
|
||||
action->setText(i18n("&Opacity"));
|
||||
}
|
||||
|
||||
mMoveOpAction = popup->addAction(i18n("&Move"));
|
||||
mMoveOpAction->setIcon(KIcon("transform-move"));
|
||||
kaction = qobject_cast<KAction*>(keys->action("Window Move"));
|
||||
|
@ -246,14 +227,6 @@ void Workspace::discardPopup()
|
|||
add_tabs_popup = NULL;
|
||||
}
|
||||
|
||||
void Workspace::setPopupClientOpacity(QAction* action)
|
||||
{
|
||||
if (active_popup_client == NULL)
|
||||
return;
|
||||
int level = action->data().toInt();
|
||||
active_popup_client->setOpacity(level / 100.0);
|
||||
}
|
||||
|
||||
void Workspace::slotIncreaseWindowOpacity()
|
||||
{
|
||||
if (!active_client) {
|
||||
|
@ -335,15 +308,6 @@ void Workspace::clientPopupAboutToShow()
|
|||
mRemoveTabGroup->setVisible(tabGroupSize > 1);
|
||||
mCloseGroup->setVisible(tabGroupSize > 1);
|
||||
}
|
||||
|
||||
if (trans_popup != NULL) {
|
||||
foreach (QAction * action, trans_popup->actions()) {
|
||||
if (action->data().toInt() == qRound(active_popup_client->opacity() * 100))
|
||||
action->setChecked(true);
|
||||
else
|
||||
action->setChecked(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Workspace::initSwitchToTab()
|
||||
|
@ -462,7 +426,7 @@ void Workspace::initDesktopPopup()
|
|||
|
||||
QAction *action = desk_popup->menuAction();
|
||||
// set it as the first item
|
||||
popup->insertAction(trans_popup ? trans_popup->menuAction() : mMoveOpAction, action);
|
||||
popup->insertAction(mMoveOpAction, action);
|
||||
action->setText(i18n("To &Desktop"));
|
||||
}
|
||||
|
||||
|
@ -485,7 +449,7 @@ void Workspace::initActivityPopup()
|
|||
|
||||
QAction *action = activity_popup->menuAction();
|
||||
// set it as the first item
|
||||
popup->insertAction(trans_popup ? trans_popup->menuAction() : mMoveOpAction, action);
|
||||
popup->insertAction(mMoveOpAction, action);
|
||||
action->setText(i18n("Ac&tivities")); //FIXME is that a good string?
|
||||
}
|
||||
|
||||
|
|
|
@ -136,7 +136,6 @@ Workspace::Workspace(bool restore)
|
|||
#endif
|
||||
, popup(0)
|
||||
, advanced_popup(0)
|
||||
, trans_popup(0)
|
||||
, desk_popup(0)
|
||||
, activity_popup(0)
|
||||
, add_tabs_popup(0)
|
||||
|
|
|
@ -653,7 +653,6 @@ private slots:
|
|||
void writeWindowRules();
|
||||
void slotBlockShortcuts(int data);
|
||||
void slotReloadConfig();
|
||||
void setPopupClientOpacity(QAction* action);
|
||||
void setupCompositing();
|
||||
void finishCompositing();
|
||||
void fallbackToXRenderCompositing();
|
||||
|
@ -816,8 +815,6 @@ private:
|
|||
|
||||
QMenu* popup;
|
||||
QMenu* advanced_popup;
|
||||
QMenu* trans_popup;
|
||||
QActionGroup* trans_popup_group;
|
||||
QMenu* desk_popup;
|
||||
QMenu* activity_popup;
|
||||
QMenu* add_tabs_popup; // Menu to add the group to other group
|
||||
|
|
Loading…
Reference in a new issue