MKV 위 막대: 어림으로 두 줄을 정하던 것을 빼고 실제로 잰 것만 (242 보충)

- 버그: 900 에서 한 줄에 들어가는데 어림이 두 줄로 바꿨다 (scale_menu_test)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
묶음5
RyuJongJin 2026-10-12 01:43:11 +09:00
parent a20a7bfe79
commit 8bfcb7ceda
2 changed files with 12 additions and 31 deletions

View File

@ -27,7 +27,6 @@ bool isCompact(BuildContext context) => MediaQuery.sizeOf(context).width < compa
/// 좁은 화면에서는 두 줄 - 위: [nav] … [actions], 아래: [middle] 이 한 줄을 다 쓴다. /// 좁은 화면에서는 두 줄 - 위: [nav] … [actions], 아래: [middle] 이 한 줄을 다 쓴다.
/// [minMiddleWidth] (201): 한 줄일 때 middle 이 이보다 좁아지면 (폰 가로처럼 넓지만 버튼이 폭을 다 차지할 때) 두 줄로. /// [minMiddleWidth] (201): 한 줄일 때 middle 이 이보다 좁아지면 (폰 가로처럼 넓지만 버튼이 폭을 다 차지할 때) 두 줄로.
/// 브라우저 주소 칸처럼 middle 이 꼭 보여야 하는 화면이 준다 (0 이면 폭만으로 정함). /// 브라우저 주소 칸처럼 middle 이 꼭 보여야 하는 화면이 준다 (0 이면 폭만으로 정함).
/// [twoRows] (242): 화면이 직접 잰 결과 한 줄에 다 들어가지 않으면 두 줄로 (MKV 화면 - 작업 중 버튼이 늘 때).
/// [trailing] (242): middle 오른쪽에 붙는, 줄지 않는 버튼 묶음 - 이것 때문에 middle 이 [minMiddleWidth] 보다 좁아지면 두 줄 /// [trailing] (242): middle 오른쪽에 붙는, 줄지 않는 버튼 묶음 - 이것 때문에 middle 이 [minMiddleWidth] 보다 좁아지면 두 줄
/// (어림한 폭이 실제보다 작아 넘친 버튼이 화면 크기 "100%" 를 덮던 것 - 실제로 재어 정한다) /// (어림한 폭이 실제보다 작아 넘친 버튼이 화면 크기 "100%" 를 덮던 것 - 실제로 재어 정한다)
class AppTopBar extends StatefulWidget { class AppTopBar extends StatefulWidget {
@ -36,15 +35,13 @@ class AppTopBar extends StatefulWidget {
final Widget? trailing; final Widget? trailing;
final Widget actions; final Widget actions;
final double minMiddleWidth; final double minMiddleWidth;
final bool twoRows;
const AppTopBar( const AppTopBar(
{super.key, {super.key,
required this.nav, required this.nav,
required this.middle, required this.middle,
this.trailing, this.trailing,
required this.actions, required this.actions,
this.minMiddleWidth = 0, this.minMiddleWidth = 0});
this.twoRows = false});
@override @override
State<AppTopBar> createState() => _AppTopBarState(); State<AppTopBar> createState() => _AppTopBarState();
@ -68,7 +65,7 @@ class _AppTopBarState extends State<AppTopBar> {
final nav = widget.nav, middle = widget.middle, actions = widget.actions; final nav = widget.nav, middle = widget.middle, actions = widget.actions;
final width = MediaQuery.sizeOf(context).width; final width = MediaQuery.sizeOf(context).width;
final narrow = _twoRowsAtOrBelow != null && width <= _twoRowsAtOrBelow!; final narrow = _twoRowsAtOrBelow != null && width <= _twoRowsAtOrBelow!;
if (!isCompact(context) && !narrow && !widget.twoRows) { if (!isCompact(context) && !narrow) {
if (widget.minMiddleWidth > 0) WidgetsBinding.instance.addPostFrameCallback((_) => _check(width)); if (widget.minMiddleWidth > 0) WidgetsBinding.instance.addPostFrameCallback((_) => _check(width));
return Container( return Container(
height: appBarHeight, height: appBarHeight,

View File

@ -278,10 +278,8 @@ class _TopBar extends StatelessWidget {
final count = c.checked.isEmpty ? '' : ' (${c.checked.length})'; final count = c.checked.isEmpty ? '' : ' (${c.checked.length})';
// 창 너비에 맞춰 차례로 줄인다: 제목 글 → 왼쪽 버튼을 아이콘만 → 재생 · 브라우저를 아이콘만 → CPU · MEM 숨김. // 창 너비에 맞춰 차례로 줄인다: 제목 글 → 왼쪽 버튼을 아이콘만 → 재생 · 브라우저를 아이콘만 → CPU · MEM 숨김.
// (오른쪽의 화면 크기 · 환경 설정 · 종료 버튼은 어떤 너비에서도 밀려나지 않게) // (오른쪽의 화면 크기 · 환경 설정 · 종료 버튼은 어떤 너비에서도 밀려나지 않게)
final compactScreen = isCompact(context); final compact = isCompact(context);
return LayoutBuilder(builder: (context, box) { return LayoutBuilder(builder: (context, box) {
// 242: 한 줄에 안 들어가면 이 그리기에서만 두 줄 (좁은 화면) 처럼 잰다
var compact = compactScreen;
final hasAi = c.aiAvailable; final hasAi = c.aiAvailable;
final hasPlayer = c.services.createMediaPlayer != null; final hasPlayer = c.services.createMediaPlayer != null;
var title = true, leftText = true, rightText = true, usage = c.usage != null, jobText = true; var title = true, leftText = true, rightText = true, usage = c.usage != null, jobText = true;
@ -309,28 +307,15 @@ class _TopBar extends StatelessWidget {
(c.checked.isEmpty ? 0 : 3 * 26) + (c.checked.isEmpty ? 0 : 3 * 26) +
8; // 여유 8; // 여유
final w = box.maxWidth; final w = box.maxWidth;
void shrink() { if (compact) title = false;
title = leftText = rightText = jobText = dlBox = mkvText = true; if (need() > w) title = false;
usage = c.usage != null; if (need() > w) jobText = false;
dlBox = downloads != null; if (need() > w) leftText = false;
if (compact) title = false; if (need() > w) rightText = false;
if (need() > w) title = false; if (need() > w) usage = false;
if (need() > w) jobText = false; if (need() > w) dlBox = false;
if (need() > w) leftText = false; if (need() > w) mkvText = false;
if (need() > w) rightText = false; // 242: 다 줄여도 모자라는지는 어림 (need) 이 아니라 위 막대가 실제로 잰다 (오른쪽 묶음 [trailing] · minMiddleWidth)
if (need() > w) usage = false;
if (need() > w) dlBox = false;
if (need() > w) mkvText = false;
}
shrink();
// 242: 다 줄여도 한 줄에 안 들어가면 (폰 가로에서 작업 중 - 진행 표시 · 취소가 늘 때) 두 줄로 다시 잰다.
// 예전에는 넘친 버튼 (결과 폴더) 이 오른쪽의 화면 크기 "100%" 를 덮었다
final twoRows = !compact && need() > w;
if (twoRows) {
compact = true;
shrink();
}
// 7: 폰에는 "탐색기에서 끌어다 놓기" 가 없다 // 7: 폰에는 "탐색기에서 끌어다 놓기" 가 없다
final addTip = Platform.isAndroid ? tr('동영상 추가') : tr('동영상 추가 (탐색기에서 끌어다 놓아도 됩니다)'); final addTip = Platform.isAndroid ? tr('동영상 추가') : tr('동영상 추가 (탐색기에서 끌어다 놓아도 됩니다)');
@ -377,7 +362,6 @@ class _TopBar extends StatelessWidget {
VoidCallback? build0() => VoidCallback? build0() =>
!canBuild ? null : (batch.isEmpty ? () => _confirmBuildAll(context) : () => c.buildVideos(batch)); !canBuild ? null : (batch.isEmpty ? () => _confirmBuildAll(context) : () => c.buildVideos(batch));
return AppTopBar( return AppTopBar(
twoRows: twoRows, // 242: 넓은 화면인데 한 줄에 안 들어갈 때도 이 두 줄 배치
nav: const AppNavButtons(onMkvPage: true), nav: const AppNavButtons(onMkvPage: true),
actions: AppActions(c: c, onExit: onExit, showUsage: false), actions: AppActions(c: c, onExit: onExit, showUsage: false),
middle: SingleChildScrollView( middle: SingleChildScrollView(