| 3632 | } |
| 3633 | |
| 3634 | void Window::handleCustomQuickTileShortcut(QuickTileMode mode) |
| 3635 | { |
| 3636 | if (mode == QuickTileFlag::None) { |
| 3637 | return; |
| 3638 | } |
| 3639 | // if window is not tiled already, set it to nearest one |
| 3640 | Tile *tileAtPoint = workspace()->rootTile(workspace()->outputAt(moveResizeGeometry().center()))->pick(moveResizeGeometry().center()); |
| 3641 | if (!tileAtPoint) { |
| 3642 | return; |
| 3643 | } |
| 3644 | if (tileAtPoint != m_requestedTile) { |
| 3645 | tileAtPoint->manage(this); |
| 3646 | return; |
| 3647 | } |
| 3648 | const auto customTile = qobject_cast<CustomTile *>(tileAtPoint); |
| 3649 | if (!customTile) { |
| 3650 | return; |
| 3651 | } |
| 3652 | // Get the next tile that is not a layout tile from the edge |
| 3653 | Qt::Edge edge; |
| 3654 | if (mode & QuickTileFlag::Left) { |
| 3655 | edge = Qt::LeftEdge; |
| 3656 | } |
| 3657 | if (mode & QuickTileFlag::Right) { |
| 3658 | edge = Qt::RightEdge; |
| 3659 | } |
| 3660 | if (mode & QuickTileFlag::Top) { |
| 3661 | edge = Qt::TopEdge; |
| 3662 | } |
| 3663 | if (mode & QuickTileFlag::Bottom) { |
| 3664 | edge = Qt::BottomEdge; |
| 3665 | } |
| 3666 | CustomTile *next = customTile->nextNonLayoutTileAt(edge); |
| 3667 | if (next) { |
| 3668 | next->manage(this); |
| 3669 | } |
| 3670 | } |
| 3671 | |
| 3672 | void Window::setQuickTileModeAtCurrentPosition(QuickTileMode mode) |
| 3673 | { |