From e1c04b7c3e2519af5c0f3e85a7f8e5bd8eeca16b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 7 Feb 2011 19:19:51 +0100 Subject: [PATCH] Add shortcuts for new quick tile modes. Shortcuts for quick tile to the quarters of the screen added in 4.6. Thanks to Arthur Arlt for implementing this feature. FEATURE: 265461 FIXED-IN: 4.7.0 CCMAIL: arre2000@gmx.de --- kwinbindings.cpp | 8 ++++++++ placement.cpp | 32 ++++++++++++++++++++++++++++++++ workspace.h | 4 ++++ 3 files changed, 44 insertions(+) diff --git a/kwinbindings.cpp b/kwinbindings.cpp index fd23915a16..0a2c1fc290 100644 --- a/kwinbindings.cpp +++ b/kwinbindings.cpp @@ -122,6 +122,14 @@ DEF2("Window Quick Tile Left", I18N_NOOP("Quick Tile Window to the Left"), 0, slotWindowQuickTileLeft()); DEF2("Window Quick Tile Right", I18N_NOOP("Quick Tile Window to the Right"), 0, slotWindowQuickTileRight()); +DEF2("Window Quick Tile Top Left", I18N_NOOP("Quick Tile Window to the Top Left"), + 0, slotWindowQuickTileTopLeft()); +DEF2("Window Quick Tile Bottom Left", I18N_NOOP("Quick Tile Window to the Bottom Left"), + 0, slotWindowQuickTileBottomLeft()); +DEF2("Window Quick Tile Top Right", I18N_NOOP("Quick Tile Window to the Top Right"), + 0, slotWindowQuickTileTopRight()); +DEF2("Window Quick Tile Bottom Right", I18N_NOOP("Quick Tile Window to the Bottom Right"), + 0, slotWindowQuickTileBottomRight()); DEF2("Switch Window Up", I18N_NOOP("Switch to Window Above"), Qt::META + Qt::ALT + Qt::Key_Up, slotSwitchWindowUp()); DEF2("Switch Window Down", I18N_NOOP("Switch to Window Below"), diff --git a/placement.cpp b/placement.cpp index a578803864..0f3d4d3926 100644 --- a/placement.cpp +++ b/placement.cpp @@ -700,6 +700,38 @@ void Workspace::slotWindowQuickTileRight() active_client->setQuickTileMode(QuickTileRight, true); } +void Workspace::slotWindowQuickTileTopLeft() +{ + if (!active_client) { + return; + } + active_client->setQuickTileMode(QuickTileTopLeft, true); +} + +void Workspace::slotWindowQuickTileTopRight() +{ + if (!active_client) { + return; + } + active_client->setQuickTileMode(QuickTileTopRight, true); +} + +void Workspace::slotWindowQuickTileBottomLeft() +{ + if (!active_client) { + return; + } + active_client->setQuickTileMode(QuickTileBottomLeft, true); +} + +void Workspace::slotWindowQuickTileBottomRight() +{ + if (!active_client) { + return; + } + active_client->setQuickTileMode(QuickTileBottomRight, true); +} + int Workspace::packPositionLeft(const Client* cl, int oldx, bool left_edge) const { int newx = clientArea(MovementArea, cl).left(); diff --git a/workspace.h b/workspace.h index 34ca651f21..fe97c776c4 100644 --- a/workspace.h +++ b/workspace.h @@ -764,6 +764,10 @@ public slots: void slotWindowShrinkVertical(); void slotWindowQuickTileLeft(); void slotWindowQuickTileRight(); + void slotWindowQuickTileTopLeft(); + void slotWindowQuickTileTopRight(); + void slotWindowQuickTileBottomLeft(); + void slotWindowQuickTileBottomRight(); void slotWalkThroughDesktops(); void slotWalkBackThroughDesktops();