diff --git a/lib/ui/app_actions.dart b/lib/ui/app_actions.dart index cafc0ac..808cd71 100644 --- a/lib/ui/app_actions.dart +++ b/lib/ui/app_actions.dart @@ -240,7 +240,22 @@ class AppNavButtons extends StatelessWidget { }; // 좁은 화면 (폰): 아이콘 아래에 짧은 이름 - 글자 없는 작은 아이콘만 늘어서 무엇인지 몰랐던 것 final labels = isCompact(context); - Widget btn(Widget icon, String tip, VoidCallback? f, {bool here = false, String label = ''}) => labels + // 지금 화면 버튼 아래 밑줄 (색만으로는 알아보기 어려운 사람도 어디인지 알게) + Widget underline(Widget child, bool here) => !here + ? child + : Stack(clipBehavior: Clip.none, children: [ + child, + Positioned( + left: 10, + right: 10, + bottom: 0, + child: Container( + key: const ValueKey('nav-here-underline'), + height: 3, + decoration: BoxDecoration(color: JjColors.accent, borderRadius: BorderRadius.circular(2))), + ), + ]); + Widget btn0(Widget icon, String tip, VoidCallback? f, {bool here = false, String label = ''}) => labels ? Tooltip( message: tip, child: InkWell( @@ -284,6 +299,7 @@ class AppNavButtons extends StatelessWidget { onPressed: f, ), ); + Widget btn(Widget icon, String tip, VoidCallback? f, {bool here = false, String label = ''}) => underline(btn0(icon, tip, f, here: here, label: label), here); String short(String id) => switch (id) { 'mkv' => 'MKV', 'browser' => tr('브라우저'), diff --git a/test/batch_test.dart b/test/batch_test.dart index 2370f1a..b7b73e6 100644 --- a/test/batch_test.dart +++ b/test/batch_test.dart @@ -393,6 +393,11 @@ void main() { // MKV 화면: 뒤로 · MKV 는 "지금 여기" 라 꺼짐, 다운로드 목록 열기 expect(btn('뒤로').onPressed, isNull); expect(find.byTooltip('MKV 화면 (지금 여기)'), findsOneWidget); + // 지금 화면 버튼 아래 밑줄 하나 (그 버튼 아래에) + final line = find.byKey(const ValueKey('nav-here-underline')); + expect(line, findsOneWidget); + final mkv = tester.getRect(find.byTooltip('MKV 화면 (지금 여기)')); + expect(tester.getCenter(line).dx, closeTo(mkv.center.dx, 2)); await tester.tap(find.byTooltip('다운로드 목록')); await tester.pumpAndSettle(); expect(find.textContaining('다운로드 ('), findsOneWidget);