Skip to content

fix(GUI): rewrite LoadedView options layout at default window size#71

Merged
ShadyUnderLight merged 1 commit intomainfrom
fix/loadedview-layout
Apr 21, 2026
Merged

fix(GUI): rewrite LoadedView options layout at default window size#71
ShadyUnderLight merged 1 commit intomainfrom
fix/loadedview-layout

Conversation

@ShadyUnderLight
Copy link
Copy Markdown
Owner

Problem

At the default window size (640×560), the LoadedView options area had two issues:

  1. Content-area collapse: The inner VStack inside the ScrollView had .frame(maxHeight: .infinity), which made SwiftUI assign infinite height to a scrollable child — causing the content to collapse or expand unpredictably.
  2. Options clipping: All options (chapter source, output dir, filename template, overwrite policy, output format) were laid out in a single HStack row. With the 260pt chapter-source Picker taking most of the width, the right-side controls ("冲突处理", "输出格式") were compressed or invisible at 640pt.

Solution

  1. Remove .frame(maxHeight: .infinity) from the inner VStack so ScrollView sizes content naturally.
  2. Add .frame(maxWidth: .infinity) to header and options so they fill the ScrollView's width.
  3. Replace the single-row options HStack with a two-row VStack, each row split into labeled sections (caption2 group headers) with fixed min widths — no more invisible controls.
  4. Use a dual-Spacer in Row 1 to visually center the output-directory group.

Changes

  • GUI/Views/ContentView.swift: Complete rewrite of the optionsSection computed property; structural changes to LoadedView.body

- Break single-row HStack into two-row VStack with labeled sections
- Remove .frame(maxHeight: .infinity) that caused content-area collapse
- Add .frame(maxWidth: .infinity) on header/options to fill ScrollView width
- Use dual Spacer in Row 1 to visually center the output-dir group
- All options now display correctly at default window size (640×560)
@ShadyUnderLight ShadyUnderLight merged commit 757f7f1 into main Apr 21, 2026
1 check passed
@ShadyUnderLight ShadyUnderLight deleted the fix/loadedview-layout branch April 21, 2026 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant