diff --git a/lib/ui/app_actions.dart b/lib/ui/app_actions.dart index 6bc291a..cafc0ac 100644 --- a/lib/ui/app_actions.dart +++ b/lib/ui/app_actions.dart @@ -98,13 +98,17 @@ class AppNavButtons extends StatelessWidget { /// AI 그림 화면 자신 (123) final bool onAiPage; + + /// 174: MKV 화면 자신 - 홈 화면이 탐색기 등이면 MKV 화면이 맨 처음 화면이 아닐 수 있어 따로 알린다 + final bool onMkvPage; const AppNavButtons( {super.key, this.onDownloadsPage = false, this.onBrowserPage = false, this.onExplorerPage = false, this.onRsyncPage = false, - this.onAiPage = false}); + this.onAiPage = false, + this.onMkvPage = false}); /// 버튼 줄의 가장 넓은 폭 (JJ · 화면 6개 · 뒤로) static const double width = 8 * 40; @@ -214,7 +218,7 @@ class AppNavButtons extends StatelessWidget { ? 'rsync' : onAiPage ? 'aiimage' - : atRoot + : onMkvPage || atRoot ? 'mkv' : ''; final pages = scope == null ? const [] : pagesOf(scope); diff --git a/lib/ui/home_page.dart b/lib/ui/home_page.dart index de60a2b..c981379 100644 --- a/lib/ui/home_page.dart +++ b/lib/ui/home_page.dart @@ -264,7 +264,7 @@ class _TopBar extends StatelessWidget { VoidCallback? build0() => !canBuild ? null : (batch.isEmpty ? () => _confirmBuildAll(context) : () => c.buildVideos(batch)); return AppTopBar( - nav: const AppNavButtons(), + nav: const AppNavButtons(onMkvPage: true), actions: AppActions(c: c, onExit: onExit, showUsage: false), middle: SingleChildScrollView( scrollDirection: Axis.horizontal, @@ -315,7 +315,7 @@ class _TopBar extends StatelessWidget { return AppTopBar( // 모든 화면 공통: [JJ 홈] [MKV 화면] [뒤로] [다운로드 목록] - nav: const AppNavButtons(), + nav: const AppNavButtons(onMkvPage: true), // 화면 크기 · 환경 설정 · 종료: 모든 화면에서 같은 자리 actions: AppActions(c: c, onExit: onExit, showUsage: usage), middle: Row( diff --git a/test/components_test.dart b/test/components_test.dart index bb31c08..eba6650 100644 --- a/test/components_test.dart +++ b/test/components_test.dart @@ -137,4 +137,23 @@ void main() { expect(AppSettings().browserSwipeHinted, isFalse); expect(AppSettings.fromJson((AppSettings()..browserSwipeHinted = true).toJson()).browserSwipeHinted, isTrue); }); + + testWidgets('174: MKV 화면이 맨 처음 화면이 아니어도 (홈 화면 = 탐색기 등) MKV 아이콘이 "지금 여기"', (tester) async { + tester.view.physicalSize = const Size(1500, 900); + tester.view.devicePixelRatio = 1; + addTearDown(tester.view.reset); + final c = _plain(); + c.settings + ..components = ['mkv', 'explorer'] + ..navOrder = ['mkv', 'explorer']; + final navKey = GlobalKey(); + await tester.pumpWidget(MaterialApp( + navigatorKey: navKey, + builder: (context, child) => AppScope(controller: c, child: child!), + home: const Scaffold(body: Text('맨 처음 화면')), + )); + navKey.currentState!.push(MaterialPageRoute(builder: (_) => HomePage(c: c))); + await tester.pumpAndSettle(); + expect(find.byTooltip('MKV 화면 (지금 여기)'), findsOneWidget); + }); }