isSelected -> isHighlighted

This commit is contained in:
Soh Satoh
2025-01-26 22:42:59 +09:00
parent ae8ddb234f
commit 27b59f7c2d
2 changed files with 4 additions and 6 deletions

View File

@ -9,8 +9,7 @@ struct QuickTerminalTabBarView: View {
ForEach(tabManager.tabs) { tab in
QuickTerminalTabItemView(
tab: tab,
isSelected: tab.isActive,
isSingleTab: tabManager.tabs.count == 1,
isHighlighted: tab.isActive,
onSelect: { tabManager.selectTab(tab) },
onClose: { tabManager.closeTab(tab) }
)

View File

@ -2,8 +2,7 @@ import SwiftUI
struct QuickTerminalTabItemView: View {
@ObservedObject var tab: QuickTerminalTab
let isSelected: Bool
let isSingleTab: Bool
let isHighlighted: Bool
let onSelect: () -> Void
let onClose: () -> Void
@ -21,7 +20,7 @@ struct QuickTerminalTabItemView: View {
.animation(.easeInOut, value: isHovered)
Text(tab.title)
.foregroundColor(isSelected ? .primary : .secondary)
.foregroundColor(isHighlighted ? .primary : .secondary)
.lineLimit(1)
.truncationMode(.tail)
.frame(minWidth: 0, maxWidth: .infinity)
@ -31,7 +30,7 @@ struct QuickTerminalTabItemView: View {
.background(
Rectangle()
.fill(
isSelected && !isSingleTab
isHighlighted
? Color(NSColor.controlBackgroundColor)
: (isHovered ? Color(NSColor.underPageBackgroundColor) : Color(NSColor.windowBackgroundColor)))
)