mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-10-17 16:54:01 -04:00
island/bar: square blur region corners where goth paths paint square
ref #3191
This commit is contained in:
@@ -265,6 +265,28 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: blurCornerRegionComp
|
||||
|
||||
// BarCanvas paints square corners at the attached edge and the wing roots (#2975); re-add what the body radius rounds off
|
||||
Region {
|
||||
id: cornerRegion
|
||||
|
||||
property bool atRight: false
|
||||
property bool atBottom: false
|
||||
|
||||
readonly property real r: barBackground.rt
|
||||
readonly property bool attachedEdgeCorner: (barBackground.isTop && !atBottom) || (barBackground.isBottom && atBottom) || (barBackground.isLeft && !atRight) || (barBackground.isRight && atRight)
|
||||
readonly property bool wingEdgeCorner: (barBackground.isTop && atBottom) || (barBackground.isBottom && !atBottom) || (barBackground.isLeft && atRight) || (barBackground.isRight && !atRight)
|
||||
readonly property bool squared: (barBackground.edgeAttached && attachedEdgeCorner) || (barBackground.gothEnabled && wingEdgeCorner)
|
||||
|
||||
x: topBarMouseArea.x + barUnitInset.x + topBarSlide.x + (atRight ? barUnitInset.width - r : 0)
|
||||
y: topBarMouseArea.y + barUnitInset.y + topBarSlide.y + (atBottom ? barUnitInset.height - r : 0)
|
||||
width: squared ? r : 0
|
||||
height: squared ? r : 0
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
id: barBlur
|
||||
visible: false
|
||||
@@ -319,6 +341,19 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
if (hasBar) {
|
||||
for (const atRight of [false, true]) {
|
||||
for (const atBottom of [false, true]) {
|
||||
const corner = blurCornerRegionComp.createObject(region, {
|
||||
atRight: atRight,
|
||||
atBottom: atBottom
|
||||
});
|
||||
if (corner)
|
||||
subRegions.push(corner);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
region.regions = subRegions;
|
||||
|
||||
barWindow.blurRegion = region;
|
||||
|
||||
@@ -204,8 +204,8 @@ Item {
|
||||
subRegions.push(islandSub);
|
||||
}
|
||||
for (const chrome of chromes) {
|
||||
const body = blurItemRegionComp.createObject(region, {
|
||||
w: chrome
|
||||
const body = blurChromeRegionComp.createObject(region, {
|
||||
chrome: chrome
|
||||
});
|
||||
if (body)
|
||||
subRegions.push(body);
|
||||
@@ -313,6 +313,49 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: blurChromeRegionComp
|
||||
|
||||
// The chrome paints square corners at the attached edge (and above the sweep in edge mode); square those blur corners too
|
||||
Region {
|
||||
id: body
|
||||
|
||||
property Item chrome
|
||||
|
||||
readonly property real cr: body.chrome.cornerR
|
||||
readonly property real edgeY: body.chrome.bottomEdge ? body.y + body.height - body.cr : body.y
|
||||
readonly property real sweepY: body.chrome.bottomEdge ? body.y : body.y + body.height - body.cr
|
||||
readonly property bool sweepSquare: !body.chrome.floating && body.chrome.sweepR > 0
|
||||
|
||||
x: body.chrome.x
|
||||
y: body.chrome.y
|
||||
width: body.chrome.width
|
||||
height: body.chrome.height
|
||||
radius: body.cr
|
||||
|
||||
Region {
|
||||
x: body.x
|
||||
y: body.edgeY
|
||||
width: body.cr
|
||||
height: body.cr
|
||||
}
|
||||
|
||||
Region {
|
||||
x: body.x + body.width - body.cr
|
||||
y: body.edgeY
|
||||
width: body.cr
|
||||
height: body.cr
|
||||
}
|
||||
|
||||
Region {
|
||||
x: body.chrome.rightSide ? body.x + body.width - body.cr : body.x
|
||||
y: body.sweepY
|
||||
width: body.sweepSquare ? body.cr : 0
|
||||
height: body.sweepSquare ? body.cr : 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: blurIslandRegionComp
|
||||
|
||||
|
||||
Reference in New Issue
Block a user