diff options
Diffstat (limited to 'modules/drawers')
| -rw-r--r-- | modules/drawers/Backgrounds.qml | 2 | ||||
| -rw-r--r-- | modules/drawers/Border.qml | 6 | ||||
| -rw-r--r-- | modules/drawers/Drawers.qml | 8 | ||||
| -rw-r--r-- | modules/drawers/Exclusions.qml | 3 | ||||
| -rw-r--r-- | modules/drawers/Interactions.qml | 15 | ||||
| -rw-r--r-- | modules/drawers/Panels.qml | 4 |
6 files changed, 21 insertions, 17 deletions
diff --git a/modules/drawers/Backgrounds.qml b/modules/drawers/Backgrounds.qml index 1840da1..46ca477 100644 --- a/modules/drawers/Backgrounds.qml +++ b/modules/drawers/Backgrounds.qml @@ -16,7 +16,7 @@ Shape { required property Item bar anchors.fill: parent - anchors.margins: BorderConfig.thickness + anchors.margins: Config.border.thickness anchors.leftMargin: bar.implicitWidth preferredRendererType: Shape.CurveRenderer opacity: Colours.transparency.enabled ? Colours.transparency.base : 1 diff --git a/modules/drawers/Border.qml b/modules/drawers/Border.qml index 9014d07..62dc277 100644 --- a/modules/drawers/Border.qml +++ b/modules/drawers/Border.qml @@ -16,7 +16,7 @@ Item { id: rect anchors.fill: parent - color: Colours.alpha(BorderConfig.colour, false) + color: Colours.alpha(Config.border.colour, false) visible: false } @@ -29,9 +29,9 @@ Item { Rectangle { anchors.fill: parent - anchors.margins: BorderConfig.thickness + anchors.margins: Config.border.thickness anchors.leftMargin: root.bar.implicitWidth - radius: BorderConfig.rounding + radius: Config.border.rounding } } diff --git a/modules/drawers/Drawers.qml b/modules/drawers/Drawers.qml index 9930c6d..5cab75b 100644 --- a/modules/drawers/Drawers.qml +++ b/modules/drawers/Drawers.qml @@ -33,9 +33,9 @@ Variants { mask: Region { x: bar.implicitWidth - y: BorderConfig.thickness - width: win.width - bar.implicitWidth - BorderConfig.thickness - height: win.height - BorderConfig.thickness * 2 + y: Config.border.thickness + width: win.width - bar.implicitWidth - Config.border.thickness + height: win.height - Config.border.thickness * 2 intersection: Intersection.Xor regions: regions.instances @@ -55,7 +55,7 @@ Variants { required property Item modelData x: modelData.x + bar.implicitWidth - y: modelData.y + BorderConfig.thickness + y: modelData.y + Config.border.thickness width: modelData.width height: modelData.height intersection: Intersection.Subtract diff --git a/modules/drawers/Exclusions.qml b/modules/drawers/Exclusions.qml index 188aadb..5557cdb 100644 --- a/modules/drawers/Exclusions.qml +++ b/modules/drawers/Exclusions.qml @@ -31,6 +31,7 @@ Scope { component ExclusionZone: StyledWindow { screen: root.screen name: "border-exclusion" - exclusiveZone: BorderConfig.thickness + exclusiveZone: Config.border.thickness + mask: Region {} } } diff --git a/modules/drawers/Interactions.qml b/modules/drawers/Interactions.qml index 10e37a8..d38cc8a 100644 --- a/modules/drawers/Interactions.qml +++ b/modules/drawers/Interactions.qml @@ -20,8 +20,8 @@ MouseArea { property bool osdShortcutActive function withinPanelHeight(panel: Item, x: real, y: real): bool { - const panelY = BorderConfig.thickness + panel.y; - return y >= panelY - BorderConfig.rounding && y <= panelY + panel.height + BorderConfig.rounding; + const panelY = Config.border.thickness + panel.y; + return y >= panelY - Config.border.rounding && y <= panelY + panel.height + Config.border.rounding; } function inRightPanel(panel: Item, x: real, y: real): bool { @@ -30,7 +30,7 @@ MouseArea { function inTopPanel(panel: Item, x: real, y: real): bool { const panelX = bar.implicitWidth + panel.x; - return y < BorderConfig.thickness + panel.y + panel.height && x >= panelX - BorderConfig.rounding && x <= panelX + panel.width + BorderConfig.rounding; + return y < Config.border.thickness + panel.y + panel.height && x >= panelX - Config.border.rounding && x <= panelX + panel.width + Config.border.rounding; } anchors.fill: parent @@ -51,7 +51,10 @@ MouseArea { } } - onPositionChanged: ({x, y}) => { + onPositionChanged: ({ + x, + y + }) => { // Show osd on hover const showOsd = inRightPanel(panels.osd, x, y); @@ -68,9 +71,9 @@ MouseArea { // Show/hide session on drag if (pressed && withinPanelHeight(panels.session, x, y)) { const dragX = x - dragStart.x; - if (dragX < -SessionConfig.dragThreshold) + if (dragX < -Config.session.dragThreshold) visibilities.session = true; - else if (dragX > SessionConfig.dragThreshold) + else if (dragX > Config.session.dragThreshold) visibilities.session = false; } diff --git a/modules/drawers/Panels.qml b/modules/drawers/Panels.qml index 6c6d892..a422fcc 100644 --- a/modules/drawers/Panels.qml +++ b/modules/drawers/Panels.qml @@ -24,7 +24,7 @@ Item { readonly property BarPopouts.Wrapper popouts: popouts anchors.fill: parent - anchors.margins: BorderConfig.thickness + anchors.margins: Config.border.thickness anchors.leftMargin: bar.implicitWidth Component.onCompleted: Visibilities.panels[screen] = this @@ -83,7 +83,7 @@ Item { anchors.left: parent.left anchors.verticalCenter: parent.top anchors.verticalCenterOffset: { - const off = root.popouts.currentCenter - BorderConfig.thickness; + const off = root.popouts.currentCenter - Config.border.thickness; const diff = root.height - Math.floor(off + implicitHeight / 2); if (diff < 0) return off + diff; |