diff --git a/mac/Sources/Byre/Format.swift b/mac/Sources/Byre/Format.swift index e31dd54..3a1419a 100644 --- a/mac/Sources/Byre/Format.swift +++ b/mac/Sources/Byre/Format.swift @@ -544,6 +544,30 @@ struct DropdownMenu: View { } } +struct PaneRow: ViewModifier { + var tabs = false + + func body(content: Content) -> some View { + Text("Ag") + .font(Fonts.font(13, weight: tabs ? 400 : 700)) + .padding(.vertical, tabs ? 7 : 6) + .hidden() + .frame(maxWidth: .infinity) + .overlay { content.frame(maxWidth: .infinity, maxHeight: .infinity) } + } +} + +struct PaneTabBar: ViewModifier { + func body(content: Content) -> some View { + content + .padding(.horizontal, 12) + .modifier(PaneRow(tabs: true)) + .overlay(alignment: .bottom) { + Rectangle().fill(Palette.border).frame(height: 1) + } + } +} + struct HeaderBar: ViewModifier { func body(content: Content) -> some View { content diff --git a/mac/Sources/Byre/Pages.swift b/mac/Sources/Byre/Pages.swift index 86af5b9..2a41c0f 100644 --- a/mac/Sources/Byre/Pages.swift +++ b/mac/Sources/Byre/Pages.swift @@ -576,12 +576,8 @@ struct PageTabs: View { PageTabButton(page: page, active: page == shown.current) } } - .padding(.horizontal, 12) - } - .fixedSize(horizontal: false, vertical: true) - .overlay(alignment: .bottom) { - Rectangle().fill(Palette.border).frame(height: 1) } + .modifier(PaneTabBar()) ZStack { ForEach(shown.pages, id: \.self) { page in if let view = store.pageView(page) { diff --git a/mac/Sources/Byre/Panes.swift b/mac/Sources/Byre/Panes.swift index 92d4d4e..d402c6d 100644 --- a/mac/Sources/Byre/Panes.swift +++ b/mac/Sources/Byre/Panes.swift @@ -144,10 +144,10 @@ private struct LeftPane: View { SettingsView() } } - .overlay { - if let sheet = store.sheet, sheet.owner != .lead { - SheetHost(sheet: sheet) - } + } + .overlay { + if let sheet = store.sheet, sheet.owner != .lead { + SheetHost(sheet: sheet) } } } @@ -185,10 +185,10 @@ private struct TaskPane: View { } } } - .overlay { - if let sheet = store.sheet, sheet.owner == .lead { - SheetHost(sheet: sheet) - } + } + .overlay { + if let sheet = store.sheet, sheet.owner == .lead { + SheetHost(sheet: sheet) } } .environment(\.paneAccent, accent) @@ -338,6 +338,7 @@ struct TaskBar: View { .frame(maxWidth: .infinity) } .padding(.horizontal, 12) + .modifier(PaneRow()) .background { ZStack { Palette.bg @@ -409,10 +410,7 @@ struct TabStrip: View { FoldingTabs(tabs: info.order.map { ($0, $0.label) }, active: info.tab) { t in store.openTab(t) } - .padding(.horizontal, 12) - .overlay(alignment: .bottom) { - Rectangle().fill(Palette.border).frame(height: 1) - } + .modifier(PaneTabBar()) } } diff --git a/mac/Sources/Byre/Sheet.swift b/mac/Sources/Byre/Sheet.swift index 3c69b28..ec3670a 100644 --- a/mac/Sources/Byre/Sheet.swift +++ b/mac/Sources/Byre/Sheet.swift @@ -24,7 +24,7 @@ struct Sheet { } } -private let stripWidth: CGFloat = 56 +private let stripWidth: CGFloat = 24 private let corner: CGFloat = 8 struct SheetHost: View { @@ -108,17 +108,17 @@ private struct SheetPanel: View { .help("Close (Esc)") } .padding(.horizontal, 12) - .padding(.vertical, 7) + .modifier(PaneRow()) .background(accent.opacity(0.12)) .overlay(alignment: .bottom) { - Rectangle().fill(accent).frame(height: 1) + Rectangle().fill(Palette.border).frame(height: 1) } SheetContent(view: sheet.view) .frame(maxWidth: .infinity, maxHeight: .infinity) } .background(Palette.bg) .clipShape(clip) - .overlay(SheetEdge(openTrailing: overLeft).stroke(accent, lineWidth: 1.5)) + .overlay(SheetEdge(openTrailing: overLeft).stroke(Palette.border, lineWidth: 1)) .shadow(color: Palette.overlayShadow, radius: 14, x: overLeft ? -6 : 6) .environment(\.paneAccent, accent) .environment(\.inTask, overLeft) diff --git a/mac/Sources/Byre/Terminal.swift b/mac/Sources/Byre/Terminal.swift index 2e0df3e..b0142bb 100644 --- a/mac/Sources/Byre/Terminal.swift +++ b/mac/Sources/Byre/Terminal.swift @@ -68,7 +68,7 @@ struct TerminalTab: View { .foregroundStyle(Palette.muted) .lineLimit(1) } - .modifier(HeaderBar()) + .modifier(PaneTabBar()) Group { if let taskId, task?.status == .active { if let current {