From 32f3b74d0824f37f78ded8cdeb8e295a66477b89 Mon Sep 17 00:00:00 2001 From: Davide Date: Wed, 27 Nov 2024 14:26:16 +0100 Subject: [PATCH] Fill empty space in installed profile header Drop some isOpaque. FIXME: placeholder. --- .../Views/App/InstalledProfileView.swift | 33 ++++++++----------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/Passepartout/Library/Sources/AppUIMain/Views/App/InstalledProfileView.swift b/Passepartout/Library/Sources/AppUIMain/Views/App/InstalledProfileView.swift index e4bbc36ef..ab4485f48 100644 --- a/Passepartout/Library/Sources/AppUIMain/Views/App/InstalledProfileView.swift +++ b/Passepartout/Library/Sources/AppUIMain/Views/App/InstalledProfileView.swift @@ -62,21 +62,25 @@ struct InstalledProfileView: View, Routable { } private extension InstalledProfileView { - var isOpaque: Bool { - profile != nil - } - var cardView: some View { - VStack(alignment: .leading, spacing: 20.0) { + VStack(alignment: .leading, spacing: 20) { HStack(alignment: .center) { if profile != nil { actionableNameView - Spacer(minLength: 10.0) + Spacer(minLength: 10) } else { nameView() } } - statusView + Group { + if profile != nil { + statusView + } else { + Text("FIXME") + .foregroundStyle(.secondary) + } + } + .font(.body) } .modifier(CardModifier(layout: layout)) } @@ -95,11 +99,7 @@ private extension InstalledProfileView { var statusView: some View { HStack { providerSelectorButton - StatusText( - theme: theme, - tunnel: tunnel, - isOpaque: isOpaque - ) + StatusText(theme: theme, tunnel: tunnel) } } @@ -111,9 +111,9 @@ private extension InstalledProfileView { nextProfileId: $nextProfileId, interactiveManager: interactiveManager, errorHandler: errorHandler, - isOpaque: isOpaque, flow: flow ) + .opaque(profile != nil) } func menuContent() -> some View { @@ -156,14 +156,10 @@ private struct StatusText: View { @ObservedObject var tunnel: ExtendedTunnel - let isOpaque: Bool - var body: some View { debugChanges() return ConnectionStatusText(tunnel: tunnel) - .font(.body) .foregroundStyle(tunnel.statusColor(theme)) - .opaque(isOpaque) } } @@ -186,8 +182,6 @@ private struct ToggleButton: View { @ObservedObject var errorHandler: ErrorHandler - let isOpaque: Bool - let flow: ProfileFlow? var body: some View { @@ -211,7 +205,6 @@ private struct ToggleButton: View { // XXX: #584, necessary to avoid cell selection .buttonStyle(.plain) .foregroundStyle(tunnel.statusColor(theme)) - .opaque(isOpaque) } }