Place apps below the title bar, not behind it
A child webview is positioned against the window frame while the shell measures the hole it left from inside the content view. Borderless, those origins coincided and it never showed. With a title bar back they are a title bar apart, so every app was drawn that much too high - painting over the right-hand part of the bar, which read as the bar being tinted by whichever site was open, and leaving a strip of the same height along the bottom. Tauri cannot report that height. Both inner_position/outer_position and inner_size/outer_size come back identical on macOS - measured, both differences were zero against a window whose content is plainly a title bar shorter than its frame. NSWindow.contentLayoutRect knows, so it is asked once and cached. Also hides the window title, and centres the navigation row in its own strip rather than letting it crowd the bar above it.
This commit is contained in:
@@ -281,6 +281,23 @@ a corner radius applied to each app's layer because a native view sitting on top
|
||||
shell cannot be clipped by the CSS around it. It is gone. A window that behaves like a
|
||||
window is worth more than one that looks bespoke.
|
||||
|
||||
### The title bar offset
|
||||
|
||||
A child webview is positioned against the **window frame**; the shell measures the hole it
|
||||
left from inside the **content view**. With a borderless window those origins coincide, so
|
||||
this never came up. With a title bar they are a title bar apart, and every app was drawn
|
||||
that much too high: it painted over the right-hand part of the bar — which read as the bar
|
||||
being tinted by whichever site was open — and left a strip of the same height along the
|
||||
bottom.
|
||||
|
||||
Tauri cannot report that height. Measured on this machine, `inner_position` and
|
||||
`outer_position` return the same point, and `inner_size` and `outer_size` return the same
|
||||
size, against a window whose content is plainly a title bar shorter than its frame. Both
|
||||
differences are zero and both are useless.
|
||||
|
||||
`NSWindow.contentLayoutRect` knows. The height is asked for once through it and cached,
|
||||
since it does not change.
|
||||
|
||||
The margin That margin is the only part of the window that is not a web page, and
|
||||
therefore the only place left to grab it by. Full screen has no use for it and gets the
|
||||
room back.
|
||||
|
||||
Reference in New Issue
Block a user