the sheet scrims its own window, not the screen
This commit is contained in:
parent
0e7dec53d1
commit
6c0730a790
1 changed files with 44 additions and 11 deletions
|
|
@ -70,6 +70,10 @@ Scope {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
scope.target = id;
|
scope.target = id;
|
||||||
|
// Ask where that window is, now. The poll runs every two seconds, and
|
||||||
|
// a sheet that opened against two-second-old geometry would scrim the
|
||||||
|
// wrong rectangle for exactly as long as it took to notice.
|
||||||
|
ViewtopControl.refreshWindows();
|
||||||
scope.sheetOpen = true;
|
scope.sheetOpen = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -197,18 +201,45 @@ Scope {
|
||||||
WlrLayershell.keyboardFocus: WlrKeyboardFocus.OnDemand
|
WlrLayershell.keyboardFocus: WlrKeyboardFocus.OnDemand
|
||||||
exclusionMode: ExclusionMode.Ignore
|
exclusionMode: ExclusionMode.Ignore
|
||||||
|
|
||||||
// The scrim. Also the outside-tap target: dismissal by tapping away
|
// The tap-away target. Transparent and full-screen: dismissal by
|
||||||
// is load-bearing on a phone, and it is the only exit that needs no
|
// tapping outside is load-bearing on a phone and is the only exit
|
||||||
// explanation.
|
// that needs no explanation, so the *catcher* still spans the
|
||||||
Rectangle {
|
// glass even though the *scrim* no longer does.
|
||||||
anchors.fill: parent
|
|
||||||
color: "#99000000"
|
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onClicked: scope.dismiss()
|
onClicked: scope.dismiss()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The scrim, over the target window only.
|
||||||
|
//
|
||||||
|
// Casey, 2026-08-05: *"Three finger tap overlay should overlay the
|
||||||
|
// app it's talking about; not all apps."* Dimming everything said
|
||||||
|
// the sheet was about the device; it is about one window, and on a
|
||||||
|
// split screen it was covering the app you were not asking about.
|
||||||
|
//
|
||||||
|
// Geometry comes from the compositor's `workspaces` reply rather
|
||||||
|
// than being computed here — the strip offset and any pose are
|
||||||
|
// facts only it holds, which is the same reason the tap carries its
|
||||||
|
// target instead of a raw point.
|
||||||
|
Rectangle {
|
||||||
|
id: scrim
|
||||||
|
readonly property var target: {
|
||||||
|
for (const w of ViewtopControl.windows)
|
||||||
|
if (w.id === scope.target && w.at && w.size)
|
||||||
|
return w;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
// Falls back to the whole screen when the compositor reported
|
||||||
|
// no geometry. A sheet with no visible subject is confusing;
|
||||||
|
// one that dims everything is merely less precise, and the
|
||||||
|
// buttons still work.
|
||||||
|
x: scrim.target ? scrim.target.at.x : 0
|
||||||
|
y: scrim.target ? scrim.target.at.y : 0
|
||||||
|
width: scrim.target ? scrim.target.size.width : parent.width
|
||||||
|
height: scrim.target ? scrim.target.size.height : parent.height
|
||||||
|
color: "#99000000"
|
||||||
|
radius: scrim.target ? 12 : 0
|
||||||
|
|
||||||
Behavior on opacity { NumberAnimation { duration: 120 } }
|
Behavior on opacity { NumberAnimation { duration: 120 } }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -271,11 +302,13 @@ Scope {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// The row. Above centre so a thumb does not cover the window.
|
// The row, centred on the window it acts on rather than on the
|
||||||
|
// panel — a sheet floating mid-screen while the app it names is in
|
||||||
|
// the top half reads as belonging to neither.
|
||||||
RowLayout {
|
RowLayout {
|
||||||
visible: !scope.choosing
|
visible: !scope.choosing
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
x: scrim.x + (scrim.width - width) / 2
|
||||||
y: parent.height * 0.38
|
y: scrim.y + scrim.height * 0.38
|
||||||
spacing: 28
|
spacing: 28
|
||||||
|
|
||||||
SheetButton {
|
SheetButton {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue