WIP 255 세로 폰 환경 설정: 묶음 바로가기를 한 줄로 (옆으로 밀기) (검토 대기)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>묶음6
parent
ed5a1407c1
commit
cab577ec8a
|
|
@ -1157,9 +1157,8 @@ class _SettingsPageState extends State<SettingsPage> {
|
||||||
};
|
};
|
||||||
|
|
||||||
/// 맨 위 바로가기: 묶음 이름을 누르면 그 묶음으로 스크롤
|
/// 맨 위 바로가기: 묶음 이름을 누르면 그 묶음으로 스크롤
|
||||||
Widget _groupBar(bool desk) => Padding(
|
Widget _groupBar(bool desk) {
|
||||||
padding: const EdgeInsets.only(bottom: 8),
|
final chips = [
|
||||||
child: Wrap(spacing: 8, runSpacing: 8, children: [
|
|
||||||
for (final id in _groupIds)
|
for (final id in _groupIds)
|
||||||
if ((id != 'run' || desk) &&
|
if ((id != 'run' || desk) &&
|
||||||
(id != 'ai' || c.settings.components.contains('aiimage')) &&
|
(id != 'ai' || c.settings.components.contains('aiimage')) &&
|
||||||
|
|
@ -1175,8 +1174,24 @@ class _SettingsPageState extends State<SettingsPage> {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
]),
|
];
|
||||||
|
// 255: 좁은 화면 (세로 폰) 은 한 줄로 옆으로 밀게 - 여러 줄로 감기면 위에 늘 고정된 4줄이 화면 절반을 차지해 내용이 반만 보였다
|
||||||
|
if (isCompact(context)) {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.only(bottom: 4),
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
child: Row(children: [
|
||||||
|
for (final (i, w) in chips.indexed) ...[if (i > 0) const SizedBox(width: 8), w],
|
||||||
|
]),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.only(bottom: 8),
|
||||||
|
child: Wrap(spacing: 8, runSpacing: 8, children: chips),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/// 묶음 하나: 제목 (아이콘) 과 항목들을 한 카드에
|
/// 묶음 하나: 제목 (아이콘) 과 항목들을 한 카드에
|
||||||
Widget _group(String id, IconData icon, String title, List<Widget> children) => Card(
|
Widget _group(String id, IconData icon, String title, List<Widget> children) => Card(
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
import 'package:jj_mkvmaker/app/app_controller.dart';
|
||||||
|
import 'package:jj_mkvmaker/platform/windows/desktop_storage_service.dart';
|
||||||
|
import 'package:jj_mkvmaker/platform/windows/process_media_tool.dart';
|
||||||
|
import 'package:jj_mkvmaker/services/platform_services.dart';
|
||||||
|
import 'package:jj_mkvmaker/ui/settings_page.dart';
|
||||||
|
|
||||||
|
/// 255: 세로 폰의 환경 설정 - 위의 묶음 바로가기가 한 줄 (여러 줄로 감겨 화면 절반을 차지하지 않게)
|
||||||
|
void main() {
|
||||||
|
for (final (size, oneRow) in [(const Size(412, 900), true), (const Size(1400, 900), false)]) {
|
||||||
|
testWidgets('255: 묶음 바로가기 (${size.width.round()}×${size.height.round()}) - 좁으면 한 줄', (tester) async {
|
||||||
|
final tmp = Directory.systemTemp.createTempSync('jj_set255_');
|
||||||
|
addTearDown(() => tmp.deleteSync(recursive: true));
|
||||||
|
const pp = MethodChannel('plugins.flutter.io/path_provider');
|
||||||
|
tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(pp, (_) async => tmp.path);
|
||||||
|
addTearDown(() => tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(pp, null));
|
||||||
|
tester.view.physicalSize = size;
|
||||||
|
tester.view.devicePixelRatio = 1;
|
||||||
|
addTearDown(tester.view.reset);
|
||||||
|
final c = AppController(PlatformServices(mediaTool: ProcessMediaTool('x', 'y'), storage: DesktopStorageService()));
|
||||||
|
await tester.runAsync(() => tester.pumpWidget(MaterialApp(home: SettingsPage(c: c))));
|
||||||
|
await tester.pump();
|
||||||
|
final tops = {for (final e in find.byType(ActionChip).evaluate()) tester.getRect(find.byWidget(e.widget)).top.round()};
|
||||||
|
expect(tops, isNotEmpty);
|
||||||
|
if (oneRow) {
|
||||||
|
expect(tops, hasLength(1), reason: '좁으면 한 줄 (옆으로 밀기)');
|
||||||
|
}
|
||||||
|
expect(tester.takeException(), isNull);
|
||||||
|
await tester.pumpWidget(const SizedBox());
|
||||||
|
await tester.pump(const Duration(seconds: 1));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue