Skip to content

Fit the iOS interface to the safe area - #1011

Open
tryk016 wants to merge 13 commits into
Try:masterfrom
tryk016:codex/pr-opengothic-ios-safe-area-20261008
Open

tryk016 wants to merge 13 commits into
Try:masterfrom
tryk016:codex/pr-opengothic-ios-safe-area-20261008

Conversation

@tryk016

@tryk016 tryk016 commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Keep menus, HUD and touch controls inside the iOS safe area, and scale the default interface to fit. Keep inventory rows below the scaled header on iOS. World rendering and videos stay full-screen.

Comment thread common/mainwindow_ios.mm Outdated
Comment thread common/mainwindow.cpp Outdated
Comment thread common/ui/inventorymenu.cpp Outdated
Comment thread common/ui/menuroot.cpp Outdated
Comment thread common/ui/stacklayout.cpp
@tryk016

tryk016 commented Oct 18, 2026

Copy link
Copy Markdown
Contributor Author

Dropped the separate scaling logic in favour of #1014. This PR only adjusts its screen-fit limit to use the safe area.

@Try

Try commented Oct 20, 2026

Copy link
Copy Markdown
Owner

Testing this on PC, with exaggerated safe-rect. Here how main menu looks:
image

My understanding that correct layout is to leave menu(and anything with ALIGN_CENTER) at center, and adjust it's position only if it overlaps with safe rect

Comment thread common/mainwindow.cpp Outdated

if(showHealthBar)
drawBar(p,barHp, 10, h()-10, hp, AlignLeft | AlignBottom);
drawBar(p,barHp, area.x+10, area.y+area.h-10, hp, AlignLeft | AlignBottom);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

h()-10
area.y+area.h-10

10 was logically already an attempt of padding. It's probably better to have h() - max(10, margin().bottom)

@tryk016

tryk016 commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Fixed the centering: menus stay at the screen center unless they overlap the safe area. HUD padding now uses max instead of adding the margins. I tested both with exaggerated margins on macOS and on the SE and Pro Max simulators.

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.

2 participants