Add ability to switch the active window tab to the left/right by

scrolling on the titlebar or when using the WM modifier key.

svn path=/trunk/KDE/kdebase/workspace/; revision=1049547
icc-effect-5.14.5
Lucas Murray 2009-11-15 12:34:46 +00:00
parent 742d31ab28
commit 72c3a553ca
4 changed files with 29 additions and 2 deletions

View File

@ -184,6 +184,7 @@ KTitleBarActionsConfig::KTitleBarActionsConfig (bool _standAlone, KConfig *_conf
comboW->addItem(i18n("Keep Above/Below"));
comboW->addItem(i18n("Move to Previous/Next Desktop"));
comboW->addItem(i18n("Change Opacity"));
comboW->addItem(i18n("Switch to Group Window to the Left/Right"));
comboW->addItem(i18n("Nothing"));
comboW->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
connect(comboW, SIGNAL(activated(int)), SLOT(changed()));
@ -474,6 +475,7 @@ const char* tbl_TiWAc[] = {
"Above/Below",
"Previous/Next Desktop",
"Change Opacity",
"Switch to Group Window to the Left/Right",
"Nothing",
"" };
@ -484,6 +486,7 @@ const char* tbl_AllW[] = {
"Above/Below",
"Previous/Next Desktop",
"Change Opacity",
"Switch to Group Window to the Left/Right",
"Nothing",
"" };
@ -841,6 +844,7 @@ KWindowActionsConfig::KWindowActionsConfig (bool _standAlone, KConfig *_config,
combo->addItem(i18n("Keep Above/Below"));
combo->addItem(i18n("Move to Previous/Next Desktop"));
combo->addItem(i18n("Change Opacity"));
combo->addItem(i18n("Switch to Group Window to the Left/Right"));
combo->addItem(i18n("Nothing"));
connect(combo, SIGNAL(activated(int)), SLOT(changed()));
coAllW = combo;

View File

@ -340,6 +340,7 @@ Options::MouseWheelCommand Options::mouseWheelCommand(const QString &name)
if (lowerName == "above/below") return MouseWheelAboveBelow;
if (lowerName == "previous/next desktop") return MouseWheelPreviousNextDesktop;
if (lowerName == "change opacity") return MouseWheelChangeOpacity;
if (lowerName == "switch to group window to the left/right") return MouseWheelChangeGroupWindow;
return MouseWheelNothing;
}
@ -411,6 +412,8 @@ Options::MouseCommand Options::wheelToMouseCommand( MouseWheelCommand com, int d
return delta > 0 ? MousePreviousDesktop : MouseNextDesktop;
case MouseWheelChangeOpacity:
return delta > 0 ? MouseOpacityMore : MouseOpacityLess;
case MouseWheelChangeGroupWindow:
return delta > 0 ? MouseLeftGroupWindow : MouseRightGroupWindow;
default:
return MouseNothing;
}

View File

@ -229,7 +229,7 @@ class Options : public KDecorationOptions
MouseNextDesktop, MousePreviousDesktop,
MouseAbove, MouseBelow,
MouseOpacityMore, MouseOpacityLess,
MouseClose,
MouseClose, MouseLeftGroupWindow, MouseRightGroupWindow,
MouseNothing
};
@ -237,7 +237,7 @@ class Options : public KDecorationOptions
{
MouseWheelRaiseLower, MouseWheelShadeUnshade, MouseWheelMaximizeRestore,
MouseWheelAboveBelow, MouseWheelPreviousNextDesktop,
MouseWheelChangeOpacity,
MouseWheelChangeOpacity, MouseWheelChangeGroupWindow,
MouseWheelNothing
};

View File

@ -934,6 +934,26 @@ 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::MouseLeftGroupWindow:
{
int c_id = clientGroup()->indexOfClient( this );
int size = clientGroup()->clients().count();
if( c_id > 0 )
clientGroup()->setVisible( c_id - 1 );
else
clientGroup()->setVisible( size - 1 );
}
break;
case Options::MouseRightGroupWindow:
{
int c_id = clientGroup()->indexOfClient( this );
int size = clientGroup()->clients().count();
if( c_id < size - 1 )
clientGroup()->setVisible( c_id + 1 );
else
clientGroup()->setVisible( 0 );
}
break;
case Options::MouseClose:
closeWindow();
break;