From 2217c1038fcff0b349de13d2d3c19cf49c8eba50 Mon Sep 17 00:00:00 2001 From: Mika Allan Rauhala Date: Tue, 31 Mar 2015 11:09:57 +0200 Subject: [PATCH] Add Quick Tile Window to the Top and Bottom shortcuts This adds "Quick Tile Window to the Top" and "Quick Title Window to the Bottom" shortcuts. These are useful for those using displays that are in portrait orientation. CCBUG: 310005 REVIEW: 123153 --- kwinbindings.cpp | 4 ++++ placement.cpp | 16 ++++++++++++++++ scripting/workspace_wrapper.cpp | 2 ++ scripting/workspace_wrapper.h | 2 ++ workspace.h | 2 ++ 5 files changed, 26 insertions(+) diff --git a/kwinbindings.cpp b/kwinbindings.cpp index 3c9f57c47..bb1da5208 100644 --- a/kwinbindings.cpp +++ b/kwinbindings.cpp @@ -97,6 +97,10 @@ 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", I18N_NOOP("Quick Tile Window to the Top"), + 0, slotWindowQuickTileTop); +DEF2("Window Quick Tile Bottom", I18N_NOOP("Quick Tile Window to the Bottom"), + 0, slotWindowQuickTileBottom); 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"), diff --git a/placement.cpp b/placement.cpp index f1be07dd1..46cb9d446 100644 --- a/placement.cpp +++ b/placement.cpp @@ -817,6 +817,22 @@ void Workspace::slotWindowQuickTileRight() active_client->setQuickTileMode(Client::QuickTileRight, true); } +void Workspace::slotWindowQuickTileTop() +{ + if (!active_client) + return; + + active_client->setQuickTileMode(Client::QuickTileTop, true); +} + +void Workspace::slotWindowQuickTileBottom() +{ + if (!active_client) + return; + + active_client->setQuickTileMode(Client::QuickTileBottom, true); +} + void Workspace::slotWindowQuickTileTopLeft() { if (!active_client) { diff --git a/scripting/workspace_wrapper.cpp b/scripting/workspace_wrapper.cpp index 0fda6ccfc..7ce5dd859 100644 --- a/scripting/workspace_wrapper.cpp +++ b/scripting/workspace_wrapper.cpp @@ -144,6 +144,8 @@ SLOTWRAPPER(slotWindowShrinkHorizontal) SLOTWRAPPER(slotWindowShrinkVertical) SLOTWRAPPER(slotWindowQuickTileLeft) SLOTWRAPPER(slotWindowQuickTileRight) +SLOTWRAPPER(slotWindowQuickTileTop) +SLOTWRAPPER(slotWindowQuickTileBottom) SLOTWRAPPER(slotWindowQuickTileTopLeft) SLOTWRAPPER(slotWindowQuickTileTopRight) SLOTWRAPPER(slotWindowQuickTileBottomLeft) diff --git a/scripting/workspace_wrapper.h b/scripting/workspace_wrapper.h index 0d742ea29..9a2582bf9 100644 --- a/scripting/workspace_wrapper.h +++ b/scripting/workspace_wrapper.h @@ -297,6 +297,8 @@ public Q_SLOTS: void slotWindowShrinkVertical(); void slotWindowQuickTileLeft(); void slotWindowQuickTileRight(); + void slotWindowQuickTileTop(); + void slotWindowQuickTileBottom(); void slotWindowQuickTileTopLeft(); void slotWindowQuickTileTopRight(); void slotWindowQuickTileBottomLeft(); diff --git a/workspace.h b/workspace.h index 16fa351e8..0b7389f0a 100644 --- a/workspace.h +++ b/workspace.h @@ -372,6 +372,8 @@ public Q_SLOTS: void slotWindowShrinkVertical(); void slotWindowQuickTileLeft(); void slotWindowQuickTileRight(); + void slotWindowQuickTileTop(); + void slotWindowQuickTileBottom(); void slotWindowQuickTileTopLeft(); void slotWindowQuickTileTopRight(); void slotWindowQuickTileBottomLeft();