Add close window ability to customizable title bar mouse button actions.

Patch by Thomas Lundgaard.
CCMAIL: thomaslundgaard@gmail.com

svn path=/trunk/KDE/kdebase/workspace/; revision=1015273
This commit is contained in:
Lucas Murray 2009-08-25 04:10:11 +00:00
parent cea75106e3
commit c3a07890f5
4 changed files with 12 additions and 3 deletions

View file

@ -273,8 +273,9 @@ KTitleBarActionsConfig::KTitleBarActionsConfig (bool _standAlone, KConfig *_conf
<< i18n("Lower")
<< i18n("Operations Menu")
<< i18n("Toggle Raise & Lower")
<< i18n("Nothing")
<< i18n("Shade");
<< i18n("Shade")
<< i18n("Close")
<< i18n("Nothing");
combo = new QComboBox(box);
combo->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
@ -316,6 +317,7 @@ KTitleBarActionsConfig::KTitleBarActionsConfig (bool _standAlone, KConfig *_conf
<< i18n("Operations Menu")
<< i18n("Raise")
<< i18n("Lower")
<< i18n("Close")
<< i18n("Nothing");
combo = new QComboBox(box);
@ -419,8 +421,9 @@ const char* const tbl_TiAc[] = {
"Lower",
"Operations menu",
"Toggle raise and lower",
"Nothing",
"Shade",
"Close",
"Nothing",
"" };
const char* const tbl_TiInAc[] = {
@ -431,6 +434,7 @@ const char* const tbl_TiInAc[] = {
"Operations menu",
"Raise",
"Lower",
"Close",
"Nothing",
"" };

View file

@ -319,6 +319,7 @@ Options::MouseCommand Options::mouseCommand(const QString &name, bool restricted
if (lowerName == "resize") return restricted ? MouseResize : MouseUnrestrictedResize;
if (lowerName == "shade") return MouseShade;
if (lowerName == "minimize") return MouseMinimize;
if (lowerName == "close") return MouseClose;
if (lowerName == "nothing") return MouseNothing;
return MouseNothing;
}

View file

@ -224,6 +224,7 @@ class Options : public KDecorationOptions
MouseNextDesktop, MousePreviousDesktop,
MouseAbove, MouseBelow,
MouseOpacityMore, MouseOpacityLess,
MouseClose,
MouseNothing
};

View file

@ -734,6 +734,9 @@ bool Client::performMouseCommand( Options::MouseCommand command, const QPoint &g
if( !isDesktop() ) // No point in changing the opacity of the desktop
setOpacity( qMax( opacity() - 0.1, 0.1 ));
break;
case Options::MouseClose:
closeWindow();
break;
case Options::MouseNothing:
replay = true;
break;