Public Access
Give the window its v5b chrome and each session surface its own shell
This commit is contained in:
@@ -30,11 +30,16 @@ internal static class LayoutHarness
|
||||
/// Taken from <c>MainWindow.axaml</c>'s <c>MinWidth</c>/<c>MinHeight</c> by hand. A test asserts these
|
||||
/// two constants still match the XAML, so the harness cannot quietly start measuring a window larger
|
||||
/// than the one a user is allowed to drag to.
|
||||
///
|
||||
/// v5b: 1016x574 became 1081x583, exactly what the titlebar's and the rail's own fidelity passes added —
|
||||
/// see <see cref="TitleBarHeight"/>, <see cref="NavRailWidth"/> and the matching remark in
|
||||
/// <c>MainWindow.axaml</c>. <see cref="ScreenWidth"/> and <see cref="ScreenHeight"/> are both unchanged
|
||||
/// by the move, because the minimum grew by exactly what the two grew by.
|
||||
/// </remarks>
|
||||
internal const double MinimumWidth = 1016;
|
||||
internal const double MinimumWidth = 1081;
|
||||
|
||||
/// <inheritdoc cref="MinimumWidth" />
|
||||
internal const double MinimumHeight = 574;
|
||||
internal const double MinimumHeight = 583;
|
||||
|
||||
/// <summary>The hosts drawer's fixed width, from <c>HostDrawer.axaml</c>.</summary>
|
||||
/// <remarks>
|
||||
@@ -47,33 +52,95 @@ internal static class LayoutHarness
|
||||
internal const double HostDrawerWidth = 320;
|
||||
|
||||
/// <summary>The nav rail's fixed width, from <c>NavRail.axaml</c>.</summary>
|
||||
internal const double NavRailWidth = 190;
|
||||
/// <remarks>v5b: 190 became 255, the design's own number rather than this bar's old approximation.</remarks>
|
||||
internal const double NavRailWidth = 255;
|
||||
|
||||
/// <summary>
|
||||
/// What the titlebar, the tab strip and the status bar take off the window before any screen gets a
|
||||
/// pixel.
|
||||
/// What the titlebar and the status bar take off the window before any screen gets a pixel.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// All three are fixed heights declared in their own markup — 44, 42 and 24 — rather than shapes that
|
||||
/// grow with their contents, which is what makes stating them here honest. Three tests hold the three
|
||||
/// controls to those numbers, so the budget below cannot drift away from what the window actually
|
||||
/// leaves.
|
||||
/// Both are fixed heights declared in their own markup — 53 and 24 — rather than shapes that grow with
|
||||
/// their contents, which is what makes stating them here honest. A test holds each control to its own
|
||||
/// number, so the budget below cannot drift away from what the window actually leaves.
|
||||
///
|
||||
/// v5b: the titlebar's own 44 became 53, the design's own height; see <see cref="MinimumHeight"/> for
|
||||
/// the matching rise that keeps every screen below it the same size it always measured.
|
||||
///
|
||||
/// A third constant, <c>TerminalTabsHeight</c>, stood beside these two through v5b's chrome wave: the
|
||||
/// window-wide tab strip that used to sit above every screen, 42 pixels, whether or not there were any
|
||||
/// tabs to draw. v5b's session-shell wave retires that strip — see <c>MainWindow.axaml</c>'s own remark
|
||||
/// on where a session's tabs live now — and with it the constant: <see cref="ScreenHeight"/> no longer
|
||||
/// subtracts anything for a row that no longer exists as chrome above every screen. The tab row itself
|
||||
/// is now inside the two screens that carry one, at its own 38-pixel height; see
|
||||
/// <see cref="SessionTabRowHeight"/>, which only those two screens' own budgets pay.
|
||||
/// </remarks>
|
||||
internal const double TitleBarHeight = 44;
|
||||
internal const double TitleBarHeight = 53;
|
||||
|
||||
/// <inheritdoc cref="TitleBarHeight" />
|
||||
internal const double StatusBarHeight = 24;
|
||||
|
||||
/// <summary>The v5b session shell's own tab row, from <c>App.axaml</c>'s <c>Button.sesstab</c> rule.</summary>
|
||||
/// <remarks>
|
||||
/// Not part of <see cref="ScreenHeight"/>'s budget, unlike the retired window-wide strip this replaced:
|
||||
/// only the terminal and SFTP surfaces pay it, out of their own 26-pixel padded column — see
|
||||
/// <see cref="SessionShellPadding"/> — rather than every screen paying it as chrome. Stated here so a
|
||||
/// test can hold <c>SessionTabRow</c> to it the same way <c>TheChromeIsTheHeightTheBudgetAssumes</c>
|
||||
/// holds the titlebar and the status bar to theirs.
|
||||
/// </remarks>
|
||||
internal const double SessionTabRowHeight = 38;
|
||||
|
||||
/// <summary>The v5b session shell's own padded column, from the design's <c>padding: 26px</c>.</summary>
|
||||
internal const double SessionShellPadding = 26;
|
||||
|
||||
/// <summary>The v5b session shell's own right-hand sidebar, from <c>SessionSidebar.axaml</c>.</summary>
|
||||
internal const double SessionSidebarWidth = 300;
|
||||
|
||||
/// <summary>The v5b session shell's own host header, from <c>SessionHeader.axaml</c>.</summary>
|
||||
internal const double SessionHeaderHeight = 60;
|
||||
|
||||
/// <summary>The v5b session shell's own status bar, from <c>SessionStatusBar.axaml</c>.</summary>
|
||||
internal const double SessionStatusBarHeight = 37;
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc cref="TitleBarHeight" path="/summary" />
|
||||
/// The bordered container both session-shell screens sit inside, from <c>MainWindow.axaml</c>'s
|
||||
/// <c>BorderThickness="1"</c> around the header/pane/status-bar column and the sidebar beside it.
|
||||
/// </summary>
|
||||
internal const double SessionShellBorderThickness = 1;
|
||||
|
||||
/// <summary>
|
||||
/// ◆ THE REAL BUDGET WAVE C CLOSES. What the terminal and SFTP surfaces' own screen — <c>TransfersScreen</c>
|
||||
/// today, and whatever sits in the terminal's own pane — actually gets once the session shell built in
|
||||
/// wave B has taken its padding, its tab row, its header and its status bar. Wave B left
|
||||
/// <c>MeasureConnectingAsync</c> and <c>MeasureHostKeyAsync</c> measuring at the roomier
|
||||
/// <see cref="ScreenWidth"/>/<see cref="ScreenHeight"/> instead, with a remark on each admitting the gap;
|
||||
/// this is what closes it.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// It comes off every screen, not just the hosts screen, which is the layout consequence of the strip
|
||||
/// spanning the window. The strip does not collapse when there are no tabs — a row of chrome that came
|
||||
/// and went would move every screen up and down by 42 pixels each time the last tab closed — so this is
|
||||
/// a fixed cost rather than a conditional one, and the budget can be a constant.
|
||||
/// The arithmetic, top to bottom: <see cref="ScreenHeight"/> less <see cref="SessionShellPadding"/> on
|
||||
/// both the top and the bottom of the outer padded column, less <see cref="SessionTabRowHeight"/> for the
|
||||
/// tab row that sits above the bordered container, less <see cref="SessionShellBorderThickness"/> on both
|
||||
/// the top and the bottom of that border, less <see cref="SessionHeaderHeight"/> and
|
||||
/// <see cref="SessionStatusBarHeight"/> for the two fixed strips the pane sits between.
|
||||
/// </remarks>
|
||||
internal const double TerminalTabsHeight = 42;
|
||||
internal static double SessionScreenHeight =>
|
||||
ScreenHeight - (2 * SessionShellPadding) - SessionTabRowHeight - (2 * SessionShellBorderThickness)
|
||||
- SessionHeaderHeight - SessionStatusBarHeight;
|
||||
|
||||
/// <summary>
|
||||
/// The width a session-shell screen gets, with or without <c>SessionSidebar</c>'s own QUICK ACCESS
|
||||
/// column showing beside it.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <see cref="ScreenWidth"/> less <see cref="SessionShellPadding"/> on both the left and the right of the
|
||||
/// outer padded column, less <see cref="SessionShellBorderThickness"/> on both the left and the right of
|
||||
/// the bordered container, less <see cref="SessionSidebarWidth"/> when the sidebar is showing beside the
|
||||
/// pane rather than collapsed — see <c>MainWindowViewModel.ShowsQuickAccessSidebar</c>, which for the
|
||||
/// SFTP surface is exactly <c>Transfers.IsConnected</c>: the caller passes that fact in rather than this
|
||||
/// harness guessing it, because it is a fact about a view model this file knows nothing about.
|
||||
/// </remarks>
|
||||
internal static double SessionScreenWidth(bool sidebarVisible) =>
|
||||
ScreenWidth - (2 * SessionShellPadding) - (2 * SessionShellBorderThickness)
|
||||
- (sidebarVisible ? SessionSidebarWidth : 0);
|
||||
|
||||
/// <summary>The update banner's fixed height, from <c>UpdateBanner.axaml</c>.</summary>
|
||||
/// <remarks>
|
||||
@@ -111,12 +178,17 @@ internal static class LayoutHarness
|
||||
/// <summary>Everything between the titlebar and the status bar, at the window's minimum.</summary>
|
||||
internal static double ContentHeight => MinimumHeight - TitleBarHeight - StatusBarHeight;
|
||||
|
||||
/// <summary>The height a screen actually gets at the window's minimum.</summary>
|
||||
/// <summary>
|
||||
/// The height a full-bleed page screen actually gets at the window's minimum.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Less than <see cref="ContentHeight"/> by the tab strip, which spans every screen and does not
|
||||
/// collapse when there are no tabs.
|
||||
/// Equal to <see cref="ContentHeight"/> since v5b's session-shell wave retired the window-wide tab strip
|
||||
/// that used to be subtracted here — see <see cref="TitleBarHeight"/>'s own remark. The terminal and
|
||||
/// SFTP surfaces pay for their own tab row, header and status bar out of their own budget now, which
|
||||
/// this constant does not describe; a test measuring either of those two screens has to account for the
|
||||
/// session shell's own geometry rather than reading it off this property.
|
||||
/// </remarks>
|
||||
internal static double ScreenHeight => ContentHeight - TerminalTabsHeight;
|
||||
internal static double ScreenHeight => ContentHeight;
|
||||
|
||||
/// <summary>The width a full-width screen gets, once the nav rail has taken its column.</summary>
|
||||
internal static double ScreenWidth => MinimumWidth - NavRailWidth;
|
||||
|
||||
Reference in New Issue
Block a user