Shell: Settings has no list column, so its tab bar stays at the right edge
This commit is contained in:
@@ -180,8 +180,10 @@ class _AdaptiveShellState extends State<AdaptiveShell> {
|
|||||||
listenable: Listenable.merge([_bar.badges, _bar.bar, _paneWidths]),
|
listenable: Listenable.merge([_bar.badges, _bar.bar, _paneWidths]),
|
||||||
builder: (context, _) {
|
builder: (context, _) {
|
||||||
// On a wide window the bar stays under the list column even when no
|
// On a wide window the bar stays under the list column even when no
|
||||||
// item is open (Search, a list alone), so it never jumps sides.
|
// item is open (Search, a list alone), so it never jumps sides. A page
|
||||||
final split = _bar.split(_selected) || showsListBesideDetail(context);
|
// (Settings) has no list column, so its bar stays at the right edge.
|
||||||
|
final split =
|
||||||
|
_bar.split(_selected) || (!page && showsListBesideDetail(context));
|
||||||
return ListPaneWidth(
|
return ListPaneWidth(
|
||||||
split: split,
|
split: split,
|
||||||
preferredWidth: _paneWidths.widthFor(_selected.name),
|
preferredWidth: _paneWidths.widthFor(_selected.name),
|
||||||
|
|||||||
@@ -77,12 +77,14 @@ void main() {
|
|||||||
bool tabs = false,
|
bool tabs = false,
|
||||||
double textScale = 1,
|
double textScale = 1,
|
||||||
ListPaneWidthStore? store,
|
ListPaneWidthStore? store,
|
||||||
|
AppDestination destination = AppDestination.chat,
|
||||||
}) {
|
}) {
|
||||||
final app = AdaptiveShell(
|
final app = AdaptiveShell(
|
||||||
cupertino: cupertino,
|
cupertino: cupertino,
|
||||||
listPaneWidthStore: store ?? MemoryListPaneWidthStore(),
|
listPaneWidthStore: store ?? MemoryListPaneWidthStore(),
|
||||||
destination: AppDestination.chat,
|
destination: destination,
|
||||||
destinationBodies: {
|
destinationBodies: {
|
||||||
|
AppDestination.settings: (_) => const SizedBox.expand(),
|
||||||
AppDestination.chat: (_) => split
|
AppDestination.chat: (_) => split
|
||||||
? ListDetailPanes(
|
? ListDetailPanes(
|
||||||
list: listBody(),
|
list: listBody(),
|
||||||
@@ -211,6 +213,17 @@ void main() {
|
|||||||
expect(pill.right, lessThanOrEqualTo(list.right - kFloatingBarMargin));
|
expect(pill.right, lessThanOrEqualTo(list.right - kFloatingBarMargin));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
testWidgets('$host 1200 Settings: a page without a list keeps the bar '
|
||||||
|
'at the right edge', (tester) async {
|
||||||
|
await setSize(tester, const Size(1200, 800));
|
||||||
|
await tester.pumpWidget(
|
||||||
|
shell(cupertino: cupertino, destination: AppDestination.settings),
|
||||||
|
);
|
||||||
|
await tester.pump();
|
||||||
|
final pill = destinationPill(tester);
|
||||||
|
expect(pill.right, closeTo(1200 - kFloatingBarMargin, 0.5));
|
||||||
|
});
|
||||||
|
|
||||||
testWidgets('$host 1200 unsplit: the bar stays under the list column', (
|
testWidgets('$host 1200 unsplit: the bar stays under the list column', (
|
||||||
tester,
|
tester,
|
||||||
) async {
|
) async {
|
||||||
|
|||||||
Reference in New Issue
Block a user