mirror of
https://git.outfoxxed.me/quickshell/quickshell.git
synced 2025-11-06 19:14:57 +11:00
wayland/layershell: support auto exclusive zone without constraint
This commit is contained in:
parent
bb206e3a19
commit
3b4ebc5f16
3 changed files with 24 additions and 3 deletions
|
|
@ -1,6 +1,7 @@
|
|||
#include "wlr_layershell.hpp"
|
||||
|
||||
#include <qlogging.h>
|
||||
#include <qnamespace.h>
|
||||
#include <qobject.h>
|
||||
#include <qqmllist.h>
|
||||
#include <qquickitem.h>
|
||||
|
|
@ -20,13 +21,15 @@ WlrLayershell::WlrLayershell(QObject* parent): ProxyWindowBase(parent) {
|
|||
case ExclusionMode::Ignore: return -1;
|
||||
case ExclusionMode::Normal: return this->bExclusiveZone;
|
||||
case ExclusionMode::Auto:
|
||||
const auto anchors = this->bAnchors.value();
|
||||
const auto edge = this->bcExclusionEdge.value();
|
||||
|
||||
if (anchors.horizontalConstraint()) return this->bImplicitHeight;
|
||||
else if (anchors.verticalConstraint()) return this->bImplicitWidth;
|
||||
if (edge == Qt::TopEdge || edge == Qt::BottomEdge) return this->bImplicitHeight;
|
||||
else if (edge == Qt::LeftEdge || edge == Qt::RightEdge) return this->bImplicitWidth;
|
||||
else return 0;
|
||||
}
|
||||
});
|
||||
|
||||
this->bcExclusionEdge.setBinding([this] { return this->bAnchors.value().exclusionEdge(); });
|
||||
}
|
||||
|
||||
ProxiedWindow* WlrLayershell::retrieveWindow(QObject* oldInstance) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue