pragma ComponentBehavior: Bound

import Quickshell
import Quickshell.Wayland
import QtQuick
import ZShell.Config
import qs.Components

Scope {
	id: root

	required property Item bar
	required property EdgeGeometry geometry
	required property ShellScreen screen

	ExclusionZone {
		id: top

		WlrLayershell.layer: WlrLayer.Overlay
		anchors.left: true
		anchors.right: true
		anchors.top: true
		hasBar: root.geometry.barOnTop
	}

	ExclusionZone {
		id: left

		anchors.left: true
		hasBar: root.geometry.barOnLeft
	}

	ExclusionZone {
		id: right

		anchors.right: true
	}

	ExclusionZone {
		id: bottom

		anchors.bottom: true
		hasBar: root.geometry.barOnBottom
	}

	Timer {
		interval: 5000
		running: true

		onTriggered: console.log("top height:", top.exclusiveZone, "left width:", left.exclusiveZone, "right width:", right.exclusiveZone, "bottom height:", bottom.exclusiveZone)
	}

	component ExclusionZone: CustomWindow {
		property bool hasBar

		exclusiveZone: hasBar ? root.bar.exclusiveZone : Config.bar.border
		implicitHeight: 1
		implicitWidth: 1
		name: "Bar-Exclusion"
		screen: root.screen

		mask: Region {
		}
	}
}
