diff options
| author | Ruben Beltran del Rio <git@r.bdr.sh> | 2024-09-16 20:37:27 +0200 |
|---|---|---|
| committer | Ruben Beltran del Rio <git@r.bdr.sh> | 2024-09-16 20:37:27 +0200 |
| commit | be897af3bd7cc010c1aa496d5b1faf8a2e1f82ed (patch) | |
| tree | 1420ad1ea92f9125bfd1d775913dd8dbc310dae6 /Map/Presentation/Base Components | |
| parent | 144915635bdfc90445321189914929a911fe77d4 (diff) | |
Address the lint warnings
Diffstat (limited to 'Map/Presentation/Base Components')
12 files changed, 196 insertions, 220 deletions
diff --git a/Map/Presentation/Base Components/EvolutionPicker.swift b/Map/Presentation/Base Components/EvolutionPicker.swift index 03f5145..2768540 100644 --- a/Map/Presentation/Base Components/EvolutionPicker.swift +++ b/Map/Presentation/Base Components/EvolutionPicker.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río +// Copyright (C) 2024 Rubén Beltrán del Río - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import SwiftUI struct EvolutionPicker: View { @@ -23,21 +21,21 @@ struct EvolutionPicker: View { var body: some View { Picker("Evolution", selection: $selectedEvolution) { ForEach(StageType.types) { stage in - Text(Stage.title(stage)).font(.theme.body).tag(stage).padding(4.0) + Text(Stage.title(stage)).font(.Theme.body).tag(stage).padding(4.0) } Divider() ForEach(StageType.characteristics) { stage in - Text(Stage.title(stage)).font(.theme.body).tag(stage).padding(4.0).font(.theme.body) + Text(Stage.title(stage)).font(.Theme.body).tag(stage).padding(4.0).font(.Theme.body) } Divider() ForEach(StageType.properties) { stage in - Text(Stage.title(stage)).font(.theme.body).tag(stage).padding(4.0) + Text(Stage.title(stage)).font(.Theme.body).tag(stage).padding(4.0) } Divider() ForEach(StageType.custom) { stage in - Text(Stage.title(stage)).font(.theme.body).tag(stage).padding(4.0) + Text(Stage.title(stage)).font(.Theme.body).tag(stage).padding(4.0) } - }.font(.theme.body).padding(.horizontal, 8.0).padding(.vertical, 4.0) + }.font(.Theme.body).padding(.horizontal, 8.0).padding(.vertical, 4.0) } } diff --git a/Map/Presentation/Base Components/MapRender/MapAxes.swift b/Map/Presentation/Base Components/MapRender/MapAxes.swift index bdbafbd..4f64135 100644 --- a/Map/Presentation/Base Components/MapRender/MapAxes.swift +++ b/Map/Presentation/Base Components/MapRender/MapAxes.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río +// Copyright (C) 2024 Rubén Beltrán del Río - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import SwiftUI struct MapAxes: View { @@ -35,14 +33,14 @@ struct MapAxes: View { path.addLine(to: CGPoint(x: mapSize.width, y: mapSize.height)) path.move(to: CGPoint(x: mapSize.width, y: mapSize.height)) path.closeSubpath() - }.stroke(Color.map.axisColor, lineWidth: lineWidth * 2) + }.stroke(Color.Map.axisColor, lineWidth: lineWidth * 2) // Y Labels - Text("Visible").font(.theme.axisLabel).foregroundColor(.map.labelColor).rotationEffect( + Text("Visible").font(.Theme.axisLabel).foregroundColor(.Map.labelColor).rotationEffect( Angle(degrees: -90.0) ) .offset(CGSize(width: -35.0, height: 0.0)) - Text("Invisible").font(.theme.axisLabel).foregroundColor(.map.labelColor).rotationEffect( + Text("Invisible").font(.Theme.axisLabel).foregroundColor(.Map.labelColor).rotationEffect( Angle(degrees: -90.0) ) .offset(CGSize(width: -40.0, height: mapSize.height - 20)) @@ -50,37 +48,37 @@ struct MapAxes: View { // X Labels Text("Uncharted") - .font(.theme.axisLabel) - .foregroundColor(.map.labelColor) + .font(.Theme.axisLabel) + .foregroundColor(.Map.labelColor) .frame(width: mapSize.width / 4, height: stageHeight / 2.0, alignment: .topLeading) .offset(CGSize(width: 0.0, height: -stageHeight / 4.0)) Text("Industrialised") - .font(.theme.axisLabel) - .foregroundColor(.map.labelColor) + .font(.Theme.axisLabel) + .foregroundColor(.Map.labelColor) .frame(width: mapSize.width / 4, height: stageHeight / 2.0, alignment: .topLeading) .offset(CGSize(width: mapSize.width - 100.0, height: -stageHeight / 4.0)) Text(evolution.i) - .font(.theme.axisLabel) - .foregroundColor(.map.labelColor) + .font(.Theme.axisLabel) + .foregroundColor(.Map.labelColor) .frame(width: w(stages[0]), height: stageHeight, alignment: .topLeading) .offset(CGSize(width: 0.0, height: mapSize.height + padding)) Text(evolution.ii) - .font(.theme.axisLabel) - .foregroundColor(.map.labelColor) + .font(.Theme.axisLabel) + .foregroundColor(.Map.labelColor) .frame(width: w(stages[1]) - w(stages[0]), height: stageHeight, alignment: .topLeading) .offset(CGSize(width: w(stages[0]), height: mapSize.height + padding)) Text(evolution.iii) - .font(.theme.axisLabel) - .foregroundColor(.map.labelColor) + .font(.Theme.axisLabel) + .foregroundColor(.Map.labelColor) .frame(width: w(stages[2]) - w(stages[1]), height: stageHeight, alignment: .topLeading) .offset(CGSize(width: w(stages[1]), height: mapSize.height + padding)) Text(evolution.iv) - .font(.theme.axisLabel) - .foregroundColor(.map.labelColor) + .font(.Theme.axisLabel) + .foregroundColor(.Map.labelColor) .frame(width: mapSize.width - w(stages[2]), height: stageHeight, alignment: .topLeading) .offset(CGSize(width: w(stages[2]), height: mapSize.height + padding)) } diff --git a/Map/Presentation/Base Components/MapRender/MapBlockers.swift b/Map/Presentation/Base Components/MapRender/MapBlockers.swift index 356c1d1..613b792 100644 --- a/Map/Presentation/Base Components/MapRender/MapBlockers.swift +++ b/Map/Presentation/Base Components/MapRender/MapBlockers.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río +// Copyright (C) 2024 Rubén Beltrán del Río - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import SwiftUI struct MapBlockers: View { @@ -34,7 +32,7 @@ struct MapBlockers: View { y: h(vertex.position.y) - vertexSize.height * 2 / 3), size: CGSize(width: vertexSize.width / 2, height: vertexSize.height * 2) ), cornerSize: cornerSize) - }.fill(Color.map.blockerColor) + }.fill(Color.Map.blockerColor) } } diff --git a/Map/Presentation/Base Components/MapRender/MapEdges.swift b/Map/Presentation/Base Components/MapRender/MapEdges.swift index a377774..3090c04 100644 --- a/Map/Presentation/Base Components/MapRender/MapEdges.swift +++ b/Map/Presentation/Base Components/MapRender/MapEdges.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río +// Copyright (C) 2024 Rubén Beltrán del Río - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import SwiftUI struct MapEdges: View { @@ -68,7 +66,7 @@ struct MapEdges: View { path.closeSubpath() }.applying( CGAffineTransform(translationX: vertexSize.width / 2.0, y: vertexSize.height / 2.0) - ).stroke(Color.map.vertexColor, lineWidth: lineWidth) + ).stroke(Color.Map.vertexColor, lineWidth: lineWidth) } } diff --git a/Map/Presentation/Base Components/MapRender/MapGroup.swift b/Map/Presentation/Base Components/MapRender/MapGroup.swift index 852c536..a5877a8 100644 --- a/Map/Presentation/Base Components/MapRender/MapGroup.swift +++ b/Map/Presentation/Base Components/MapRender/MapGroup.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río +// Copyright (C) 2024 Rubén Beltrán del Río - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import ConcaveHull import SwiftUI diff --git a/Map/Presentation/Base Components/MapRender/MapGroups.swift b/Map/Presentation/Base Components/MapRender/MapGroups.swift index 936a1fc..41ea147 100644 --- a/Map/Presentation/Base Components/MapRender/MapGroups.swift +++ b/Map/Presentation/Base Components/MapRender/MapGroups.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río +// Copyright (C) 2024 Rubén Beltrán del Río - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import ConcaveHull import SwiftUI @@ -30,7 +28,7 @@ struct MapGroups: View { } private func color(_ index: Int) -> Color { - return .map.groupColors[index % Color.map.groupColors.count] + return .Map.groupColors[index % Color.Map.groupColors.count] } } diff --git a/Map/Presentation/Base Components/MapRender/MapNotes.swift b/Map/Presentation/Base Components/MapRender/MapNotes.swift index d2d7e1f..0119154 100644 --- a/Map/Presentation/Base Components/MapRender/MapNotes.swift +++ b/Map/Presentation/Base Components/MapRender/MapNotes.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río +// Copyright (C) 2024 Rubén Beltrán del Río - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import SwiftUI struct MapNotes: View { @@ -26,11 +24,11 @@ struct MapNotes: View { var body: some View { ForEach(notes, id: \.id) { note in - Text(note.text.replacingOccurrences(of: "\\n", with: "\n")).font(.theme.note) + Text(note.text.replacingOccurrences(of: "\\n", with: "\n")).font(.Theme.note) .padding(2.0) .background(.white) - .foregroundColor(.map.labelColor) - .border(Color.map.vertexColor, width: lineWidth) + .foregroundColor(.Map.labelColor) + .border(Color.Map.vertexColor, width: lineWidth) .frame(minWidth: 16.0, maxWidth: maxWidth, alignment: .topLeading) .offset( CGSize( diff --git a/Map/Presentation/Base Components/MapRender/MapOpportunities.swift b/Map/Presentation/Base Components/MapRender/MapOpportunities.swift index 310379b..3d539d4 100644 --- a/Map/Presentation/Base Components/MapRender/MapOpportunities.swift +++ b/Map/Presentation/Base Components/MapRender/MapOpportunities.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río +// Copyright (C) 2024 Rubén Beltrán del Río - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import SwiftUI struct MapOpportunities: View { @@ -63,7 +61,7 @@ struct MapOpportunities: View { }.applying( CGAffineTransform(translationX: vertexSize.width / 2.0, y: vertexSize.height / 2.0) ).strokedPath(StrokeStyle(lineWidth: lineWidth / 4, dash: [10.0])).stroke( - Color.map.opportunityColor) + Color.Map.opportunityColor) } } diff --git a/Map/Presentation/Base Components/MapRender/MapStages.swift b/Map/Presentation/Base Components/MapRender/MapStages.swift index 754ebb2..d5e5965 100644 --- a/Map/Presentation/Base Components/MapRender/MapStages.swift +++ b/Map/Presentation/Base Components/MapRender/MapStages.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río +// Copyright (C) 2024 Rubén Beltrán del Río - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import Patterns import SwiftUI @@ -27,25 +25,25 @@ struct MapStages: View { var body: some View { ZStack(alignment: .topLeading) { PatternView( - design: .constant(.stitch), pixelSize: 1.0, foregroundColor: .map.stageForeground, - backgroundColor: .map.stageBackground + design: .constant(.stitch), pixelSize: 1.0, foregroundColor: .Map.stageForeground, + backgroundColor: .Map.stageBackground ) .frame(width: w(stages[0]), height: mapSize.height) PatternView( - design: .constant(.shingles), pixelSize: 1.0, foregroundColor: .map.stageForeground, - backgroundColor: .map.stageBackground + design: .constant(.shingles), pixelSize: 1.0, foregroundColor: .Map.stageForeground, + backgroundColor: .Map.stageBackground ) .offset(CGSize(width: w(stages[0]), height: 0)) .frame(width: w(stages[1]) - w(stages[0]), height: mapSize.height) PatternView( - design: .constant(.shadowGrid), pixelSize: 1.0, foregroundColor: .map.stageForeground, - backgroundColor: .map.stageBackground + design: .constant(.shadowGrid), pixelSize: 1.0, foregroundColor: .Map.stageForeground, + backgroundColor: .Map.stageBackground ) .offset(CGSize(width: w(stages[1]), height: 0)) .frame(width: w(stages[2]) - w(stages[1]), height: mapSize.height) PatternView( - design: .constant(.wicker), pixelSize: 1.0, foregroundColor: .map.stageForeground, - backgroundColor: .map.stageBackground + design: .constant(.wicker), pixelSize: 1.0, foregroundColor: .Map.stageForeground, + backgroundColor: .Map.stageBackground ) .offset(CGSize(width: w(stages[2]), height: 0)) .frame(width: mapSize.width - w(stages[2]), height: mapSize.height) @@ -63,7 +61,7 @@ struct MapStages: View { path.move(to: CGPoint(x: w(stages[0]), y: 0)) path.closeSubpath() }.strokedPath(StrokeStyle(lineWidth: lineWidth / 4, dash: [10.0, 18.0])).stroke( - Color.map.axisColor) + Color.Map.axisColor) } } diff --git a/Map/Presentation/Base Components/MapRender/MapVertices.swift b/Map/Presentation/Base Components/MapRender/MapVertices.swift index 1be091a..d8e3b88 100644 --- a/Map/Presentation/Base Components/MapRender/MapVertices.swift +++ b/Map/Presentation/Base Components/MapRender/MapVertices.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río +// Copyright (C) 2024 Rubén Beltrán del Río - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import SwiftUI struct MapVertices: View { @@ -29,9 +27,9 @@ struct MapVertices: View { ZStack(alignment: .topLeading) { ForEach(vertices, id: \.id) { vertex in ZStack(alignment: .topLeading) { - getVertexShape(vertex).fill(Color.map.vertexColor) - Text(vertex.label.replacingOccurrences(of: "\\n", with: "\n")).font(.theme.vertexLabel) - .foregroundColor(.map.labelColor) + getVertexShape(vertex).fill(Color.Map.vertexColor) + Text(vertex.label.replacingOccurrences(of: "\\n", with: "\n")).font(.Theme.vertexLabel) + .foregroundColor(.Map.labelColor) .shadow(color: .white, radius: 0, x: -0.5, y: -0.5) .shadow(color: .white, radius: 0, x: 0.5, y: 0.5) .offset( diff --git a/Map/Presentation/Base Components/MapTextEditor.swift b/Map/Presentation/Base Components/MapTextEditor.swift index a7dbe52..2e4f279 100644 --- a/Map/Presentation/Base Components/MapTextEditor.swift +++ b/Map/Presentation/Base Components/MapTextEditor.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río +// Copyright (C) 2024 Rubén Beltrán del Río - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import Cocoa import SwiftUI @@ -66,7 +64,7 @@ class MapTextEditorController: NSViewController { scrollView.translatesAutoresizingMaskIntoConstraints = false - textView.backgroundColor = .ui.background + textView.backgroundColor = .UI.background textView.allowsUndo = true textView.delegate = self textView.textStorage?.delegate = self @@ -94,7 +92,7 @@ class MapTextEditorController: NSViewController { for range in highlightRanges { let nsRange = NSRange(range, in: textStorage.string) - textStorage.addAttribute(.backgroundColor, value: NSColor.syntax.match, range: nsRange) + textStorage.addAttribute(.backgroundColor, value: NSColor.Syntax.match, range: nsRange) } textView.needsDisplay = true @@ -166,77 +164,77 @@ extension MapTextEditorController: NSTextStorageDelegate { for match in matches { textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.vertex], range: match.range(at: 1)) + [.foregroundColor: NSColor.Syntax.vertex], range: match.range(at: 1)) textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.number], range: match.range(at: 2)) + [.foregroundColor: NSColor.Syntax.number], range: match.range(at: 2)) textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.number], range: match.range(at: 3)) + [.foregroundColor: NSColor.Syntax.number], range: match.range(at: 3)) textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.option], range: match.range(at: 4)) + [.foregroundColor: NSColor.Syntax.option], range: match.range(at: 4)) } matches = edgeRegex.matches(in: textStorage.string, options: [], range: range) for match in matches { textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.vertex], range: match.range(at: 1)) + [.foregroundColor: NSColor.Syntax.vertex], range: match.range(at: 1)) let arrowRange = match.range(at: 2) textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.symbol], + [.foregroundColor: NSColor.Syntax.symbol], range: NSMakeRange(arrowRange.lowerBound - 1, arrowRange.length + 1)) textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.vertex], range: match.range(at: 3)) + [.foregroundColor: NSColor.Syntax.vertex], range: match.range(at: 3)) } matches = opportunityRegex.matches(in: textStorage.string, options: [], range: range) for match in matches { textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.option], range: match.range(at: 1)) + [.foregroundColor: NSColor.Syntax.option], range: match.range(at: 1)) textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.vertex], range: match.range(at: 2)) + [.foregroundColor: NSColor.Syntax.vertex], range: match.range(at: 2)) textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.symbol], range: match.range(at: 3)) + [.foregroundColor: NSColor.Syntax.symbol], range: match.range(at: 3)) textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.number], range: match.range(at: 4)) + [.foregroundColor: NSColor.Syntax.number], range: match.range(at: 4)) } matches = blockerRegex.matches(in: textStorage.string, options: [], range: range) for match in matches { textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.option], range: match.range(at: 1)) + [.foregroundColor: NSColor.Syntax.option], range: match.range(at: 1)) textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.vertex], range: match.range(at: 2)) + [.foregroundColor: NSColor.Syntax.vertex], range: match.range(at: 2)) } matches = noteRegex.matches(in: textStorage.string, options: [], range: range) for match in matches { textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.option], range: match.range(at: 1)) + [.foregroundColor: NSColor.Syntax.option], range: match.range(at: 1)) textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.number], range: match.range(at: 2)) + [.foregroundColor: NSColor.Syntax.number], range: match.range(at: 2)) textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.number], range: match.range(at: 3)) + [.foregroundColor: NSColor.Syntax.number], range: match.range(at: 3)) } matches = stageRegex.matches(in: textStorage.string, options: [], range: range) for match in matches { textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.option], range: match.range(at: 1)) + [.foregroundColor: NSColor.Syntax.option], range: match.range(at: 1)) textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.number], range: match.range(at: 2)) + [.foregroundColor: NSColor.Syntax.number], range: match.range(at: 2)) } matches = groupRegex.matches(in: textStorage.string, options: [], range: range) for match in matches { textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.option], range: match.range(at: 1)) + [.foregroundColor: NSColor.Syntax.option], range: match.range(at: 1)) textStorage.addAttributes( - [.foregroundColor: NSColor.syntax.vertex], range: match.range(at: 2)) + [.foregroundColor: NSColor.Syntax.vertex], range: match.range(at: 2)) } } } diff --git a/Map/Presentation/Base Components/SearchBar.swift b/Map/Presentation/Base Components/SearchBar.swift index 7e921b0..e5182c5 100644 --- a/Map/Presentation/Base Components/SearchBar.swift +++ b/Map/Presentation/Base Components/SearchBar.swift @@ -1,19 +1,17 @@ -/* - Copyright (C) 2024 Rubén Beltrán del Río +// Copyright (C) 2024 Rubén Beltrán del Río - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see https://map.tranquil.systems. - */ +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://map.tranquil.systems. import SwiftUI struct SearchBar: View { @@ -50,19 +48,19 @@ struct SearchBar: View { Spacer() Button(action: onPrevious) { Image(systemName: "chevron.left") - .font(.theme.smallControl) + .font(.Theme.smallControl) }.keyboardShortcut( "g", modifiers: EventModifiers([.command, .shift]) ).help("Find Previous (⇧⌘G)") Button(action: onNext) { Image(systemName: "chevron.right") - .font(.theme.smallControl) + .font(.Theme.smallControl) }.keyboardShortcut( "g", modifiers: EventModifiers([.command]) ).help("Find Next (⌘G)") Button(action: onDismiss) { Text("Done") - .font(.theme.smallControl) + .font(.Theme.smallControl) }.keyboardShortcut(.escape, modifiers: EventModifiers()) .help("Done (⎋)") }.padding(4.0) |