summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorJan Grulich <jgrulich@redhat.com>2021-02-23 08:30:04 +0100
committerJan Grulich <jgrulich@redhat.com>2021-03-03 11:44:38 +0100
commitc2e9cb8e857b14de70169ff1980a72747e40ea00 (patch)
tree2c71da55173e0e78bf2b097ac71700b8ff5e0e90 /src/plugins
parent92f747fb92004b39690867a7c8ea0549449ead90 (diff)
downloadqtwayland-c2e9cb8e857b14de70169ff1980a72747e40ea00.tar.gz
Decorations: add new argument to margins() to allow exclude shadows
We can already have shadows to be part of decoration margins, but we need a way to also get size of shadow margins itself, because they should be ignored for the purposes of aligning, placing and constraining windows. This change breaks API/ABI compatibility of QWaylandAbstractDecoration plugin, however, as stated in the header file, it is a subject of change and its API is not meant to be stable. Alternatively we can make this a separate method. Change-Id: Ib2c9982e16c4acb13a83757e6371022c0a89b74e Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/decorations/bradient/main.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/decorations/bradient/main.cpp b/src/plugins/decorations/bradient/main.cpp
index daae9fcb..b273a58f 100644
--- a/src/plugins/decorations/bradient/main.cpp
+++ b/src/plugins/decorations/bradient/main.cpp
@@ -73,7 +73,7 @@ class Q_WAYLAND_CLIENT_EXPORT QWaylandBradientDecoration : public QWaylandAbstra
public:
QWaylandBradientDecoration();
protected:
- QMargins margins() const override;
+ QMargins margins(MarginsType marginsType = Full) const override;
void paint(QPaintDevice *device) override;
bool handleMouse(QWaylandInputDevice *inputDevice, const QPointF &local, const QPointF &global,Qt::MouseButtons b,Qt::KeyboardModifiers mods) override;
bool handleTouch(QWaylandInputDevice *inputDevice, const QPointF &local, const QPointF &global, Qt::TouchPointState state, Qt::KeyboardModifiers mods) override;
@@ -130,8 +130,11 @@ QRectF QWaylandBradientDecoration::minimizeButtonRect() const
(margins().top() - BUTTON_WIDTH) / 2, BUTTON_WIDTH, BUTTON_WIDTH);
}
-QMargins QWaylandBradientDecoration::margins() const
+QMargins QWaylandBradientDecoration::margins(MarginsType marginsType) const
{
+ if (marginsType == ShadowsOnly)
+ return QMargins();
+
return QMargins(3, 30, 3, 3);
}