Skip to content

Commit 0a6302e

Browse files
committed
Change download chart color to green
1 parent 06737cc commit 0a6302e

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

qBitControl/Components/StatsChartView.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import Charts
66
struct StatsChartView: View {
77

88
@Binding public var transferData: [TransferInfo]
9+
public var color: Color = .blue
910

1011
var body: some View {
1112
VStack {
@@ -19,7 +20,7 @@ struct StatsChartView: View {
1920
.mask { RectangleMark() }
2021
.foregroundStyle(
2122
LinearGradient(
22-
gradient: Gradient(colors: [.blue.opacity(0.4), .blue.opacity(0.2)]),
23+
gradient: Gradient(colors: [self.color.opacity(0.4), self.color.opacity(0.2)]),
2324
startPoint: .top,
2425
endPoint: .bottom
2526
)
@@ -30,7 +31,7 @@ struct StatsChartView: View {
3031
y: .value("Transfer", transferData.info_speed)
3132
).interpolationMethod(.monotone)
3233
.mask { RectangleMark() }
33-
.foregroundStyle(.blue)
34+
.foregroundStyle(self.color)
3435
}.chartXScale(domain: -30...0)
3536
.chartYAxis {
3637
AxisMarks {

qBitControl/Views/TorrentViews/StatsView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ struct StatsView: View {
1616
Section(header: Text("Download")) {
1717
CustomLabelView(label: "Session Download", value: "\(qBittorrent.getFormatedSize(size: qBitDataShared.serverState?.dl_info_data ?? 0))")
1818
CustomLabelView(label: "Download Speed", value: "\(qBittorrent.getFormatedSize(size: qBitDataShared.serverState?.dl_info_speed ?? 0))/s")
19-
StatsChartView(transferData: $qBitDataShared.dlTransferData)
19+
StatsChartView(transferData: $qBitDataShared.dlTransferData, color: .green)
2020
}
2121

2222
Section(header: Text("Upload")) {

0 commit comments

Comments
 (0)