Add hotkey option to move active window to center
This commit is contained in:
parent
69417dd5f7
commit
5fdf1da808
3 changed files with 16 additions and 0 deletions
|
@ -719,6 +719,17 @@ void Workspace::slotWindowPackDown()
|
|||
}
|
||||
}
|
||||
|
||||
/** Moves the active window to the center of the screen. */
|
||||
void Workspace::slotWindowCenter()
|
||||
{
|
||||
if (active_client && active_client->isMovable()) {
|
||||
const QRect geometry = active_client->moveResizeGeometry();
|
||||
QPoint center = clientArea(MaximizeArea, active_client).center();
|
||||
active_client->packTo(center.x() - (geometry.width() / 2),
|
||||
center.y() - (geometry.height() / 2));
|
||||
}
|
||||
}
|
||||
|
||||
void Workspace::slotWindowGrowHorizontal()
|
||||
{
|
||||
if (active_client)
|
||||
|
|
|
@ -1007,6 +1007,8 @@ void Workspace::initShortcuts()
|
|||
Qt::CTRL + Qt::ALT + Qt::Key_A, slotActivateAttentionWindow);
|
||||
DEF(I18N_NOOP("Setup Window Shortcut"),
|
||||
0, slotSetupWindowShortcut);
|
||||
DEF2("Window Move Center", I18N_NOOP("Move Window to the Center"), 0,
|
||||
slotWindowCenter);
|
||||
DEF2("Window Pack Right", I18N_NOOP("Pack Window to the Right"),
|
||||
0, slotWindowPackRight);
|
||||
DEF2("Window Pack Left", I18N_NOOP("Pack Window to the Left"),
|
||||
|
|
|
@ -441,6 +441,9 @@ public Q_SLOTS:
|
|||
void slotWindowLower();
|
||||
void slotWindowRaiseOrLower();
|
||||
void slotActivateAttentionWindow();
|
||||
|
||||
void slotWindowCenter();
|
||||
|
||||
void slotWindowPackLeft();
|
||||
void slotWindowPackRight();
|
||||
void slotWindowPackUp();
|
||||
|
|
Loading…
Reference in a new issue