mirror of
https://github.com/abue-ammar/tinycast.git
synced 2026-10-02 08:14:38 +08:00
Refactor BarButton to use rounded shape and update AI Chat tab hint to utilize BarButton
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
import SwiftUI
|
||||
|
||||
/// A bar control's hover chrome. The footer's buttons are capsules; one that opens a menu takes
|
||||
/// that menu's own corner instead, so the control and what it opens read as one piece.
|
||||
/// A bar control's hover chrome. The footer's buttons are capsules; a header control takes the
|
||||
/// menu row's own corner instead, so every control along that row reads as one family.
|
||||
enum BarButtonChrome {
|
||||
case capsule
|
||||
case menu
|
||||
case rounded
|
||||
|
||||
var shape: AnyShape {
|
||||
switch self {
|
||||
case .capsule:
|
||||
return AnyShape(Capsule())
|
||||
case .menu:
|
||||
case .rounded:
|
||||
return AnyShape(
|
||||
RoundedRectangle(cornerRadius: Theme.Radius.menuRow, style: .continuous))
|
||||
}
|
||||
@@ -66,7 +66,7 @@ struct HeaderMenuButton: View {
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
BarButton(chrome: .menu, action: action) {
|
||||
BarButton(chrome: .rounded, action: action) {
|
||||
HStack(spacing: Theme.Spacing.sm) {
|
||||
switch icon {
|
||||
case .symbol(let name):
|
||||
|
||||
@@ -543,15 +543,17 @@ struct RootPaletteView: View {
|
||||
}
|
||||
|
||||
/// Nothing else advertises Tab, so the launcher says where it goes — the footer's own pairing
|
||||
/// of a label with its cap, never a click target: the header belongs to the field.
|
||||
/// of a label with its cap, and the click does exactly what the key it names does.
|
||||
private var aiChatTabHint: some View {
|
||||
HStack(spacing: Theme.Spacing.sm) {
|
||||
Text("AI Chat")
|
||||
.font(Theme.Typography.bar)
|
||||
.foregroundStyle(Theme.Colors.textSecondary)
|
||||
KeyCapChip(text: "⇥", style: .outline)
|
||||
BarButton(chrome: .rounded, action: cycleMode) {
|
||||
HStack(spacing: Theme.Spacing.sm) {
|
||||
Text("AI Chat")
|
||||
.font(Theme.Typography.bar)
|
||||
.foregroundStyle(Theme.Colors.textSecondary)
|
||||
KeyCapChip(text: "⇥", style: .outline)
|
||||
}
|
||||
}
|
||||
.allowsHitTesting(false)
|
||||
.help("Open AI Chat ⇥")
|
||||
}
|
||||
|
||||
/// Resolved through `PaletteTabAction` rather than restated, so the hint cannot promise a
|
||||
|
||||
Reference in New Issue
Block a user