Skip to content

Commit 3d34f0c

Browse files
author
Iakov Senatov
committed
feat: add 15 new color tokens to ColorTheme and ColorThemeStore
Tokens: hiddenFile, markedFile, parentEntry, archivePath, markedCount, columnName/Size/Kind/Date, dividerNormal/Active, panelBorderActive/Inactive, warmWhite, filterActive. All 4 presets updated with theme-appropriate values. AppStorage hex overrides + applyOverrides + countOverrides + applyPreset reset.
1 parent 387d1a9 commit 3d34f0c

File tree

12 files changed

+317
-46
lines changed

12 files changed

+317
-46
lines changed

GUI/Sources/Config/DesignTokens.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ enum DesignTokens {
3737
static let panelBg = Color(nsColor: .controlBackgroundColor)
3838

3939
/// Warm white background for active panel and session table
40-
static let warmWhite = Color(#colorLiteral(red: 0.9744921875, green: 0.9672388187, blue: 0.9454787124, alpha: 0.9061729754))
40+
static var warmWhite: Color { ColorThemeStore.shared.activeTheme.warmWhite }
4141

4242
/// Separator color
4343
static let separator = Color(nsColor: .separatorColor)

GUI/Sources/Features/Panels/FilePanelView.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import SwiftUI
1212
// MARK: - File panel view for one side (left or right)
1313
struct FilePanelView: View {
1414
@Environment(AppState.self) var appState
15+
@State private var colorStore = ColorThemeStore.shared
1516
@State private var viewModel: FilePanelViewModel
1617
let containerWidth: CGFloat
1718
@Binding var leftPanelWidth: CGFloat
@@ -132,8 +133,8 @@ struct FilePanelView: View {
132133
RoundedRectangle(cornerRadius: DesignTokens.radius, style: .continuous)
133134
.stroke(
134135
focused
135-
? Color(#colorLiteral(red: 0.50, green: 0.50, blue: 0.55, alpha: 0.55))
136-
: Color(#colorLiteral(red: 0.45, green: 0.45, blue: 0.50, alpha: 0.38)),
136+
? colorStore.activeTheme.panelBorderActive
137+
: colorStore.activeTheme.panelBorderInactive,
137138
lineWidth: 1.5
138139
)
139140
}

GUI/Sources/Features/Panels/FileRow.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ struct FileRow: View {
293293
// MARK: - Column colors - per-column accent when not selected, white when selected+active
294294
private func cellColor(for col: ColumnID) -> Color {
295295
if isParentEntry { return Color(nsColor: .systemGray).opacity(0.6) }
296-
if file.isHidden { return Color(#colorLiteral(red: 0.3767382812, green: 0.3767382812, blue: 0.3767382812, alpha: 1)) }
296+
if file.isHidden { return colorStore.activeTheme.hiddenFileColor }
297297
return col.columnColor
298298
}
299299

GUI/Sources/Features/Panels/FileRowView.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ struct FileRowView: View {
3838

3939
private var nameColor: Color {
4040
if isMarked {
41-
return Color(#colorLiteral(red: 0.45, green: 0.0, blue: 0.0, alpha: 1))
41+
return colorStore.activeTheme.markedFileColor
4242
}
4343
if isParentEntry {
44-
return Color(#colorLiteral(red: 0.2, green: 0.2, blue: 0.7, alpha: 1))
44+
return colorStore.activeTheme.parentEntryColor
4545
}
4646
if file.isHidden {
47-
return Color(#colorLiteral(red: 0.38, green: 0.38, blue: 0.38, alpha: 1))
47+
return colorStore.activeTheme.hiddenFileColor
4848
}
4949
if file.isSymbolicLink {
5050
return colorStore.activeTheme.symlinkColor
@@ -79,7 +79,7 @@ struct FileRowView: View {
7979
.resizable()
8080
.aspectRatio(contentMode: .fit)
8181
.frame(width: DesignTokens.Row.iconSize + 2, height: DesignTokens.Row.iconSize + 2)
82-
.foregroundStyle(Color(#colorLiteral(red: 0.15, green: 0.15, blue: 0.65, alpha: 1)))
82+
.foregroundStyle(colorStore.activeTheme.parentEntryColor)
8383
.allowsHitTesting(false)
8484
.layoutPriority(1)
8585

@@ -109,7 +109,7 @@ struct FileRowView: View {
109109
if isMarked {
110110
Image(systemName: "checkmark.circle.fill")
111111
.font(.system(size: 11))
112-
.foregroundStyle(Color(#colorLiteral(red: 0.45, green: 0.0, blue: 0.0, alpha: 1)))
112+
.foregroundStyle(colorStore.activeTheme.markedFileColor)
113113
}
114114

115115
Text(file.nameStr)

GUI/Sources/Features/Panels/FileTable/ColumnLayoutModel.swift

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,20 @@ enum ColumnID: String, CaseIterable, Codable, Identifiable {
9696
}
9797
}
9898

99-
/// Per-column content text color (used in file rows)
99+
/// Per-column content text color from active theme
100100
var columnColor: Color {
101+
columnColor(from: ColorThemeStore.shared.activeTheme)
102+
}
103+
/// Per-column content text color from a given theme
104+
func columnColor(from theme: ColorTheme) -> Color {
101105
switch self {
102-
case .name: return Color(#colorLiteral(red: 0.05, green: 0.10, blue: 0.30, alpha: 1.0)) // dark navy
103-
case .size: return Color(#colorLiteral(red: 0.50, green: 0.05, blue: 0.18, alpha: 1.0)) // dark raspberry
104-
case .kind: return Color(#colorLiteral(red: 0.28, green: 0.14, blue: 0.05, alpha: 1.0)) // dark brown
106+
case .name: return theme.columnNameColor
107+
case .size: return theme.columnSizeColor
108+
case .kind: return theme.columnKindColor
105109
case .dateModified, .dateCreated,
106-
.dateLastOpened, .dateAdded: return Color(#colorLiteral(red: 0.05, green: 0.28, blue: 0.10, alpha: 1.0)) // dark green
107-
case .childCount: return Color(#colorLiteral(red: 0.05, green: 0.10, blue: 0.30, alpha: 1.0)) // dark navy
108-
default: return Color(#colorLiteral(red: 0.20, green: 0.20, blue: 0.20, alpha: 1.0)) // dark grey
110+
.dateLastOpened, .dateAdded: return theme.columnDateColor
111+
case .childCount: return theme.columnNameColor
112+
default: return theme.panelText
109113
}
110114
}
111115

GUI/Sources/Features/Panels/Filter/PanelFilterBar.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ struct PanelFilterBar: View {
8383
RoundedRectangle(cornerRadius: 6, style: .continuous)
8484
.stroke(
8585
isFocused
86-
? Color(#colorLiteral(red: 0.25, green: 0.55, blue: 1.0, alpha: 1.0)).opacity(0.8)
86+
? ColorThemeStore.shared.activeTheme.filterActiveColor
8787
: Color(nsColor: .separatorColor).opacity(0.6),
8888
lineWidth: isFocused ? 1.5 : 0.5
8989
)

GUI/Sources/Features/Panels/PanelDividerView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ enum PanelDividerStyle {
3030
static let hitAreaWidth: CGFloat = 24
3131
static let normalWidth: CGFloat = 2.0
3232
static let activeWidth: CGFloat = 5.0
33-
static let normalColor = Color(#colorLiteral(red: 0.42, green: 0.42, blue: 0.46, alpha: 0.55))
34-
static let activeColor = Color(#colorLiteral(red: 0.2196078449, green: 0.007843137719, blue: 0.8549019694, alpha: 1)).opacity(0.90)
33+
static var normalColor: Color { ColorThemeStore.shared.activeTheme.dividerNormalColor }
34+
static var activeColor: Color { ColorThemeStore.shared.activeTheme.dividerActiveColor }
3535
static let minPanelWidth: CGFloat = 80
3636
}
3737

GUI/Sources/Features/Panels/SelectionStatusBar.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import FileModelKit
1313
struct SelectionStatusBar: View {
1414
@Environment(AppState.self) var appState
1515
let panelSide: PanelSide
16+
@State private var colorStore = ColorThemeStore.shared
1617

1718
private var markedCount: Int { appState.markedCount(for: panelSide) }
1819
private var markedSize: Int64 { appState.markedTotalSize(for: panelSide) }
@@ -64,10 +65,10 @@ struct SelectionStatusBar: View {
6465
HStack(spacing: 4) {
6566
Image(systemName: "checkmark.circle.fill")
6667
.font(.system(size: 10))
67-
.foregroundStyle(Color(#colorLiteral(red: 0.7, green: 0.0, blue: 0.0, alpha: 1)))
68+
.foregroundStyle(colorStore.activeTheme.markedCountColor)
6869
Text(L10n.Selection.markedCount(markedCount))
6970
.font(.system(size: 11, weight: .medium))
70-
.foregroundStyle(Color(#colorLiteral(red: 0.7, green: 0.0, blue: 0.0, alpha: 1)))
71+
.foregroundStyle(colorStore.activeTheme.markedCountColor)
7172
}
7273
Text("").foregroundStyle(.secondary)
7374
Text(L10n.Selection.markedSize(formattedSize))

0 commit comments

Comments
 (0)