quickshell: overshoot right edge and add bottom concave ear
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
0f51a3fa49
commit
d6bbf44566
1 changed files with 32 additions and 6 deletions
|
|
@ -1182,11 +1182,11 @@ in
|
|||
anchor.rect.y: bar.height
|
||||
anchor.edges: Edges.Top | Edges.Left
|
||||
anchor.gravity: Edges.Bottom | Edges.Right
|
||||
anchor.adjustment: PopupAdjustment.Slide
|
||||
anchor.adjustment: alignRight ? PopupAdjustment.None : PopupAdjustment.Slide
|
||||
visible: false
|
||||
color: "transparent"
|
||||
implicitWidth: fullWidth + (alignRight ? 8 : 16)
|
||||
implicitHeight: fullHeight + 4
|
||||
implicitWidth: alignRight ? fullWidth + 8 + 20 : fullWidth + 16
|
||||
implicitHeight: alignRight ? fullHeight + 4 + 8 : fullHeight + 4
|
||||
|
||||
onVisibleChanged: {
|
||||
if (visible) {
|
||||
|
|
@ -1267,16 +1267,17 @@ in
|
|||
|
||||
Rectangle {
|
||||
id: _dropdownRect
|
||||
anchors.left: dropdown.alignRight ? undefined : undefined
|
||||
anchors.right: dropdown.alignRight ? parent.right : undefined
|
||||
anchors.horizontalCenter: dropdown.alignRight ? undefined : parent.horizontalCenter
|
||||
anchors.top: parent.top
|
||||
width: dropdown.fullWidth
|
||||
width: dropdown.alignRight ? dropdown.fullWidth + 20 : dropdown.fullWidth
|
||||
height: dropdown.open ? dropdown.fullHeight : 0
|
||||
color: Theme.barBg
|
||||
radius: 8
|
||||
topLeftRadius: 0
|
||||
topRightRadius: 0
|
||||
bottomRightRadius: dropdown.alignRight ? 0 : 8
|
||||
bottomRightRadius: 0
|
||||
clip: true
|
||||
|
||||
Behavior on height {
|
||||
|
|
@ -1285,7 +1286,32 @@ in
|
|||
|
||||
Item {
|
||||
id: dropdownContent
|
||||
anchors.fill: parent
|
||||
anchors.left: parent.left
|
||||
anchors.top: parent.top
|
||||
anchors.bottom: parent.bottom
|
||||
width: dropdown.fullWidth
|
||||
}
|
||||
}
|
||||
|
||||
// Bottom concave ear on right edge
|
||||
Item {
|
||||
visible: dropdown.alignRight && _dropdownRect.height > 0
|
||||
anchors.right: parent.right
|
||||
y: _dropdownRect.height
|
||||
width: 8
|
||||
height: 8
|
||||
clip: true
|
||||
Canvas {
|
||||
width: 8; height: 8
|
||||
onPaint: {
|
||||
var ctx = getContext("2d");
|
||||
ctx.clearRect(0, 0, 8, 8);
|
||||
ctx.fillStyle = Theme.barBg;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(8, 0); ctx.lineTo(8, 8); ctx.lineTo(0, 8);
|
||||
ctx.arc(0, 0, 8, Math.PI / 2, 0, true);
|
||||
ctx.closePath(); ctx.fill();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue