Skip to content

Commit 4acbfb9

Browse files
committed
fix: use alternateSelectedControlTextColor instead of hardcoded .white in selected rows
1 parent 451f2e0 commit 4acbfb9

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

TablePro/Views/DatabaseSwitcher/DatabaseSwitcherSheet.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,27 +264,27 @@ struct DatabaseSwitcherSheet: View {
264264
Image(systemName: database.icon)
265265
.font(.system(size: 14))
266266
.foregroundStyle(
267-
isSelected ? .white : (database.isSystemDatabase ? Color(nsColor: .systemOrange) : Color(nsColor: .systemBlue)))
267+
isSelected ? Color(nsColor: .alternateSelectedControlTextColor) : (database.isSystemDatabase ? Color(nsColor: .systemOrange) : Color(nsColor: .systemBlue)))
268268

269269
// Name
270270
Text(database.name)
271271
.font(.system(size: 13))
272-
.foregroundStyle(isSelected ? .white : .primary)
272+
.foregroundStyle(isSelected ? Color(nsColor: .alternateSelectedControlTextColor) : .primary)
273273

274274
Spacer()
275275

276276
// Current badge
277277
if isCurrent {
278278
Text("current")
279279
.font(.system(size: 10, weight: .medium))
280-
.foregroundStyle(isSelected ? .white.opacity(0.7) : .secondary)
280+
.foregroundStyle(isSelected ? Color(nsColor: .alternateSelectedControlTextColor).opacity(0.7) : .secondary)
281281
.padding(.horizontal, 6)
282282
.padding(.vertical, 2)
283283
.background(
284284
RoundedRectangle(cornerRadius: 4)
285285
.fill(
286286
isSelected
287-
? Color.white.opacity(0.15)
287+
? Color(nsColor: .alternateSelectedControlTextColor).opacity(0.15)
288288
: Color(nsColor: .quaternaryLabelColor))
289289
)
290290
}

TablePro/Views/QuickSwitcher/QuickSwitcherView.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,31 +163,31 @@ internal struct QuickSwitcherSheet: View {
163163
return HStack(spacing: 10) {
164164
Image(systemName: item.iconName)
165165
.font(.system(size: ThemeEngine.shared.activeTheme.iconSizes.default))
166-
.foregroundStyle(isSelected ? .white : .secondary)
166+
.foregroundStyle(isSelected ? Color(nsColor: .alternateSelectedControlTextColor) : .secondary)
167167

168168
Text(item.name)
169169
.font(.system(size: ThemeEngine.shared.activeTheme.typography.body))
170-
.foregroundStyle(isSelected ? .white : .primary)
170+
.foregroundStyle(isSelected ? Color(nsColor: .alternateSelectedControlTextColor) : .primary)
171171
.lineLimit(1)
172172
.truncationMode(.tail)
173173

174174
if !item.subtitle.isEmpty {
175175
Text(item.subtitle)
176176
.font(.system(size: ThemeEngine.shared.activeTheme.typography.small))
177-
.foregroundStyle(isSelected ? Color.white.opacity(0.7) : Color.secondary)
177+
.foregroundStyle(isSelected ? Color(nsColor: .alternateSelectedControlTextColor).opacity(0.7) : Color.secondary)
178178
.lineLimit(1)
179179
}
180180

181181
Spacer()
182182

183183
Text(item.kindLabel)
184184
.font(.system(size: ThemeEngine.shared.activeTheme.typography.caption, weight: .medium))
185-
.foregroundStyle(isSelected ? .white.opacity(0.7) : .secondary)
185+
.foregroundStyle(isSelected ? Color(nsColor: .alternateSelectedControlTextColor).opacity(0.7) : .secondary)
186186
.padding(.horizontal, 6)
187187
.padding(.vertical, 2)
188188
.background(
189189
RoundedRectangle(cornerRadius: 4)
190-
.fill(isSelected ? Color.white.opacity(0.15) : Color(nsColor: .quaternaryLabelColor))
190+
.fill(isSelected ? Color(nsColor: .alternateSelectedControlTextColor).opacity(0.15) : Color(nsColor: .quaternaryLabelColor))
191191
)
192192
}
193193
.padding(.vertical, 4)

TablePro/Views/Toolbar/ConnectionSwitcherPopover.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -234,19 +234,19 @@ struct ConnectionSwitcherPopover: View {
234234
HStack(spacing: 8) {
235235
// Color indicator
236236
Circle()
237-
.fill(isHighlighted ? Color.white : connection.displayColor)
237+
.fill(isHighlighted ? Color(nsColor: .alternateSelectedControlTextColor) : connection.displayColor)
238238
.frame(width: 8, height: 8)
239239

240240
// Connection info
241241
VStack(alignment: .leading, spacing: 1) {
242242
Text(connection.name)
243243
.font(.system(size: 13, weight: isActive ? .semibold : .regular))
244-
.foregroundStyle(isHighlighted ? .white : .primary)
244+
.foregroundStyle(isHighlighted ? Color(nsColor: .alternateSelectedControlTextColor) : .primary)
245245
.lineLimit(1)
246246

247247
Text(connectionSubtitle(connection))
248248
.font(.system(size: 11))
249-
.foregroundStyle(isHighlighted ? .white.opacity(0.7) : .secondary)
249+
.foregroundStyle(isHighlighted ? Color(nsColor: .alternateSelectedControlTextColor).opacity(0.7) : .secondary)
250250
.lineLimit(1)
251251
}
252252

@@ -258,23 +258,23 @@ struct ConnectionSwitcherPopover: View {
258258
.controlSize(.small)
259259
} else if isActive {
260260
Image(systemName: "checkmark.circle.fill")
261-
.foregroundStyle(isHighlighted ? .white : Color(nsColor: .systemGreen))
261+
.foregroundStyle(isHighlighted ? Color(nsColor: .alternateSelectedControlTextColor) : Color(nsColor: .systemGreen))
262262
.font(.system(size: 14))
263263
} else if isConnected {
264264
Circle()
265-
.fill(isHighlighted ? Color.white : Color(nsColor: .systemGreen))
265+
.fill(isHighlighted ? Color(nsColor: .alternateSelectedControlTextColor) : Color(nsColor: .systemGreen))
266266
.frame(width: 6, height: 6)
267267
}
268268

269269
// Database type badge
270270
Text(connection.type.rawValue.uppercased())
271271
.font(.system(size: 9, weight: .medium, design: .monospaced))
272-
.foregroundStyle(isHighlighted ? .white : .secondary)
272+
.foregroundStyle(isHighlighted ? Color(nsColor: .alternateSelectedControlTextColor) : .secondary)
273273
.padding(.horizontal, 4)
274274
.padding(.vertical, 2)
275275
.background(
276276
RoundedRectangle(cornerRadius: 3)
277-
.fill(isHighlighted ? Color.white.opacity(0.2) : Color(nsColor: .separatorColor))
277+
.fill(isHighlighted ? Color(nsColor: .alternateSelectedControlTextColor).opacity(0.2) : Color(nsColor: .separatorColor))
278278
)
279279
}
280280
.padding(.vertical, 2)

0 commit comments

Comments
 (0)