Merge commit 'a6d1492ad8bb88d78bf710f88dc10fa367e1dd7a' into pipelines/run-20261112-0053-ctrl-tab-cycles-floating-chat-windows-4658
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'chat_center_stage_layout.dart';
|
||||
|
||||
/// Hairline thickness of a center-stage edge.
|
||||
const double chatCenterStageEdgeThickness = 1;
|
||||
|
||||
/// Where the stage's two hairlines sit: each in the gap beside the stage, or on
|
||||
/// the workspace edge when the stage reaches it. Returns (left, right).
|
||||
(Rect, Rect) chatCenterStageEdgeRects(Rect stage, Size size) {
|
||||
final half = chatCenterStageGap / 2;
|
||||
const t = chatCenterStageEdgeThickness;
|
||||
final maxX = size.width - t;
|
||||
final leftX = stage.left <= 0
|
||||
? 0.0
|
||||
: (stage.left - half - t / 2).clamp(0.0, maxX).toDouble();
|
||||
final rightX = stage.right >= size.width
|
||||
? maxX
|
||||
: (stage.right + half - t / 2).clamp(0.0, maxX).toDouble();
|
||||
return (
|
||||
Rect.fromLTWH(leftX, 0, t, size.height),
|
||||
Rect.fromLTWH(rightX, 0, t, size.height),
|
||||
);
|
||||
}
|
||||
|
||||
/// The stage's left and right hairlines in the workspace's stack, drawn in the
|
||||
/// theme's outlineVariant so the centred chat column has a visible boundary.
|
||||
/// Only center stage calls this; the split layout keeps its own dividers.
|
||||
List<Widget> chatCenterStageEdges({
|
||||
required BuildContext context,
|
||||
required Rect rect,
|
||||
required Size size,
|
||||
}) {
|
||||
final color = Theme.of(context).colorScheme.outlineVariant;
|
||||
final (left, right) = chatCenterStageEdgeRects(rect, size);
|
||||
return [
|
||||
Positioned.fromRect(
|
||||
key: const ValueKey('chat-center-stage-edge-left'),
|
||||
rect: left,
|
||||
child: ColoredBox(color: color),
|
||||
),
|
||||
Positioned.fromRect(
|
||||
key: const ValueKey('chat-center-stage-edge-right'),
|
||||
rect: right,
|
||||
child: ColoredBox(color: color),
|
||||
),
|
||||
];
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'chat_center_stage_edges.dart';
|
||||
import 'chat_center_stage_motion.dart';
|
||||
import 'chat_center_stage_strip.dart';
|
||||
import 'chat_mobile_panes.dart';
|
||||
@@ -138,6 +139,12 @@ Widget chatWorkspaceSurface({
|
||||
for (final pane in livePanes)
|
||||
if (pane.key == ValueKey('chat-workspace-${motion.topPaneId}'))
|
||||
pane,
|
||||
if (stage.stage case final layout?)
|
||||
...chatCenterStageEdges(
|
||||
context: context,
|
||||
rect: stage.rectFor(layout.stageId)!,
|
||||
size: size,
|
||||
),
|
||||
if (mobile?.peekId != null && !motion.isAnimating)
|
||||
Positioned(
|
||||
top: mobile!.contentHeight - 12,
|
||||
|
||||
Reference in New Issue
Block a user