Skip to content

Commit 292b7e4

Browse files
committed
Add dark mode support
1 parent 0e61a27 commit 292b7e4

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

Streamline/Config/AppConstants.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ struct AppConstants {
1313
static let appName = "Streamline"
1414

1515
static let colorQuickPickerField = Color(red: 0.9, green: 0.9, blue: 0.9)
16+
static let colorQuickPickerFieldDark = Color(red: 0.1, green: 0.1, blue: 0.1)
17+
1618
static let colorQuickPickerSelected = Color(red: 84 / 255, green: 167 / 255, blue: 255 / 255)
19+
static let colorQuickPickerSelectedDark = Color(red: 33 / 255, green: 44 / 255, blue: 255 / 255)
20+
1721
static let colorTextCaption = Color(red: 0.4, green: 0.4, blue: 0.4)
1822

1923
static let streamlineFileType = UTType("me.brianyu.streamline")!

Streamline/Views/WorkflowsPanel/PanelResultView.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
import SwiftUI
99

1010
struct PanelResultView: View {
11+
@Environment(\.colorScheme) var colorScheme
12+
1113
let workflow: Workflow
1214
let isSelected: Bool
1315

@@ -21,15 +23,15 @@ struct PanelResultView: View {
2123
Text(workflow.trigger)
2224
.padding(.horizontal, 15)
2325
.padding(.vertical, 5)
24-
.background(AppConstants.colorQuickPickerField)
26+
.background(colorScheme == .dark ? AppConstants.colorQuickPickerFieldDark : AppConstants.colorQuickPickerField)
2527
.cornerRadius(10)
2628
}
2729
Text(workflow.content)
2830
.frame(height: 40, alignment: .top)
2931
}
3032
.padding(10)
3133
.frame(height: 90)
32-
.background(isSelected ? AppConstants.colorQuickPickerSelected : nil)
34+
.background(isSelected ? (colorScheme == .dark ? AppConstants.colorQuickPickerSelectedDark : AppConstants.colorQuickPickerSelected) : nil)
3335
.cornerRadius(10)
3436
}
3537
}

Streamline/Views/WorkflowsPanel/WorkflowsPanelView.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
import SwiftUI
99

1010
struct WorkflowsPanelView: View {
11+
@Environment(\.colorScheme) var colorScheme
12+
1113
let panel: StreamlinePanel
1214
let resizeWithResultsCount: (Int) -> Void
1315

@@ -29,7 +31,7 @@ struct WorkflowsPanelView: View {
2931
TextField("Search Streamline workflows...", text: $searchText)
3032
.textFieldStyle(.plain)
3133
.padding(15)
32-
.background(AppConstants.colorQuickPickerField)
34+
.background(colorScheme == .dark ? AppConstants.colorQuickPickerFieldDark : AppConstants.colorQuickPickerField)
3335
.cornerRadius(10)
3436
.font(.system(size: 18))
3537
.onChange(of: searchText) { searchText in

0 commit comments

Comments
 (0)