e4507861f7
* Allow to do quick tiling to custom tile geometries, windows will be snapped to tiles when dragged with the shift modifier pressed. * Tile geometries are screen specific. * The global shortcut Meta+T will trigger a fullscreen configuration ui as a QML effect for the tiles which allows to add, remove and resize tiles * UI and behavior is a bit similar to the Windows Fancy Zones addon: https://docs.microsoft.com/en-us/windows/powertoys/fancyzones * Its main scope is to help the workflow with very big monitors, especially ultra wide ones, where most application don't make sense maximized to the full screen (eventually also support games to be full screened to a given tile instead of the whole screen) * it should get also some bindings for scripting, as its ain goal is not to replicate other popular tiling window managers, but should give the popular kwin tiling scripts to have a more robust infrastructure * it will eventually get support for a set of predefined layouts, but this is for a second phase BUG: 438788
65 lines
1.5 KiB
C++
65 lines
1.5 KiB
C++
/*
|
|
KWin - the KDE window manager
|
|
This file is part of the KDE project.
|
|
|
|
SPDX-FileCopyrightText: 2022 Marco Martin <mart@kde.org>
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "tile.h"
|
|
#include "utils/common.h"
|
|
#include <kwin_export.h>
|
|
|
|
namespace KWin
|
|
{
|
|
|
|
class QuickRootTile;
|
|
|
|
class KWIN_EXPORT QuickTile : public Tile
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
QuickTile(TileManager *tiling, ElectricBorder border, QuickRootTile *parentItem = nullptr);
|
|
~QuickTile();
|
|
|
|
void setRelativeGeometry(const QRectF &geom) override;
|
|
|
|
private:
|
|
QuickRootTile *m_root = nullptr;
|
|
ElectricBorder m_border;
|
|
bool m_geometryLock = false;
|
|
};
|
|
|
|
class KWIN_EXPORT QuickRootTile : public Tile
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
QuickRootTile(TileManager *tiling, Tile *parentItem = nullptr);
|
|
~QuickRootTile();
|
|
|
|
Tile *tileForMode(QuickTileMode mode);
|
|
Tile *tileForBorder(ElectricBorder border);
|
|
|
|
qreal horizontalSplit() const;
|
|
void setHorizontalSplit(qreal split);
|
|
|
|
qreal verticalSplit() const;
|
|
void setVerticalSplit(qreal split);
|
|
|
|
private:
|
|
std::unique_ptr<QuickTile> m_leftVerticalTile;
|
|
std::unique_ptr<QuickTile> m_rightVerticalTile;
|
|
|
|
std::unique_ptr<QuickTile> m_topHorizontalTile;
|
|
std::unique_ptr<QuickTile> m_bottomHorizontalTile;
|
|
|
|
std::unique_ptr<QuickTile> m_topLeftTile;
|
|
std::unique_ptr<QuickTile> m_topRightTile;
|
|
std::unique_ptr<QuickTile> m_bottomLeftTile;
|
|
std::unique_ptr<QuickTile> m_bottomRightTile;
|
|
};
|
|
|
|
} // namespace KWin
|