Windows 0.3.4 connection resilience and fixed-grid source delta; no private history or other platform changes
This commit is contained in:
+13
-12
@@ -16,29 +16,28 @@ internal static class DashboardLayout
|
||||
int S(int n) => (int)Math.Round(n * scale);
|
||||
var margin = S(8); var gap = S(4);
|
||||
var compact = preferCompact || viewport.Width < S(720) || viewport.Height < S(442);
|
||||
var topOffset = compact ? -S(22) : 0;
|
||||
var topOffset = compact ? 0 : S(22);
|
||||
var width = Math.Max(1, viewport.Width - margin * 2);
|
||||
var welcome = new Rectangle(margin, 0, S(120), S(18));
|
||||
var account = new Rectangle(welcome.Right + gap, 0, Math.Min(S(160), width - S(252)), S(18));
|
||||
var identity = new Rectangle(account.Right + gap, S(1), S(50), S(16));
|
||||
var logout = new Rectangle(margin + width - S(64), 0, S(64), S(19));
|
||||
var status = new Rectangle(margin, S(22)+topOffset, width, S(32));
|
||||
var configuration = new Rectangle(margin, S(58)+topOffset, width, S(48));
|
||||
var status = new Rectangle(margin, margin+topOffset, width, S(30));
|
||||
var configuration = new Rectangle(margin, status.Bottom + gap, width, S(44));
|
||||
// The right hand actual-state panel is embedded in the same surface.
|
||||
var actualLeft = (int)Math.Round(width * .52);
|
||||
var actual = new Rectangle(actualLeft, S(3), width - actualLeft - S(8), S(42));
|
||||
var traffic = new Rectangle(margin, S(110)+topOffset, width, S(24));
|
||||
var actualLeft = width / 2 + S(4);
|
||||
var actual = new Rectangle(actualLeft, 0, width - actualLeft - S(8), configuration.Height);
|
||||
var traffic = new Rectangle(margin, configuration.Bottom + gap, width, S(24));
|
||||
var tailnet = showTailnet ? new Rectangle(margin, traffic.Bottom + gap, width, S(24)) : Rectangle.Empty;
|
||||
var daily = new Rectangle(margin, (showTailnet ? tailnet.Bottom : traffic.Bottom) + gap, width, S(28));
|
||||
var footer = new Rectangle(margin, viewport.Height - S(22), width, S(18));
|
||||
var daily = new Rectangle(margin, (showTailnet ? tailnet.Bottom : traffic.Bottom) + gap, width, S(22));
|
||||
var footer = new Rectangle(margin, viewport.Height - margin - S(18), width, S(18));
|
||||
var servers = showServerTraffic ? new Rectangle(margin, footer.Top - gap - S(38), width, S(38)) : Rectangle.Empty;
|
||||
var trendTop = daily.Bottom + gap;
|
||||
var trend = new Rectangle(margin, trendTop, width, Math.Max(S(28), (showServerTraffic ? servers.Top : footer.Top) - gap - trendTop));
|
||||
var headingWidth = S(112);
|
||||
var speedWidth = (width - headingWidth - S(16)) / 2;
|
||||
var headingWidth = S(120);
|
||||
var speedWidth = (width - headingWidth - S(10)) / 2;
|
||||
Rectangle Speed(int column) => new(headingWidth + column * speedWidth, 0, speedWidth, traffic.Height - S(2));
|
||||
var totalWidth = (width - S(76)) / 2;
|
||||
Rectangle Total(int column) => new(S(66) + column * totalWidth, 0, totalWidth, daily.Height - S(2));
|
||||
Rectangle Total(int column) => new(headingWidth + column * speedWidth, 0, speedWidth, daily.Height - S(2));
|
||||
Rectangle[] metrics = [Total(0), Speed(0), Speed(1), Total(1)];
|
||||
return new(welcome, account, identity, logout, status, configuration, actual, metrics,
|
||||
traffic, tailnet, trend, daily, servers, footer, viewport.Height, true, 1f);
|
||||
@@ -75,6 +74,8 @@ internal static class DashboardLayout
|
||||
if (p.Footer != baseline.Footer || p.ContentHeight != baseline.ContentHeight || p.TrafficCard != baseline.TrafficCard) return false;
|
||||
if (showTailnet && (p.TailnetTrafficCard.Top <= p.TrafficCard.Bottom || p.DailyCard.Top<=p.TailnetTrafficCard.Bottom)) return false;
|
||||
if(p.TrafficCard.Width!=p.SpeedTrendCard.Width || p.DailyCard.Height>Sized(40))return false;
|
||||
if (p.Metrics[0].Left != p.Metrics[1].Left || p.Metrics[3].Left != p.Metrics[2].Left
|
||||
|| p.Metrics[0].Width != p.Metrics[1].Width || p.Metrics[3].Width != p.Metrics[2].Width) return false;
|
||||
if(p.SpeedTrendCard.Height<Sized(45))return false;
|
||||
if (showServers && (p.ServerTrafficCard.Top <= p.SpeedTrendCard.Bottom || p.ServerTrafficCard.Bottom >= p.Footer.Top)) return false;
|
||||
int Sized(int n)=>(int)Math.Round(n*Math.Max(1f,dpi/96f));
|
||||
|
||||
Reference in New Issue
Block a user