From 755a7c1af844e83e2c53c3b232f5190339846f89 Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Thu, 6 Oct 2022 21:05:37 -0700 Subject: [PATCH] Meshtastic logo --- Meshtastic.xcodeproj/project.pbxproj | 4 ++++ .../logo-black.imageset/Contents.json | 23 +++++++++++++++++++ .../logo-black.imageset/Mesh_Logo_Black.svg | 12 ++++++++++ .../Mesh_Logo_Black_Large.svg | 12 ++++++++++ .../Mesh_Logo_Black_Small.svg | 12 ++++++++++ .../logo-white.imageset/Contents.json | 23 +++++++++++++++++++ .../logo-white.imageset/Mesh_Logo_White.svg | 12 ++++++++++ .../Mesh_Logo_White_Large.svg | 12 ++++++++++ .../Mesh_Logo_White_Small.svg | 12 ++++++++++ Meshtastic/Views/Bluetooth/Connect.swift | 18 +++++++-------- Meshtastic/Views/Helpers/MeshtasticLogo.swift | 22 ++++++++++++++++++ Meshtastic/Views/Messages/Contacts.swift | 3 +++ Meshtastic/Views/Nodes/NodeList.swift | 3 +++ Meshtastic/Views/Nodes/NodeMap.swift | 3 ++- Meshtastic/Views/Settings/Settings.swift | 3 +++ 15 files changed, 163 insertions(+), 11 deletions(-) create mode 100644 Meshtastic/Assets.xcassets/logo-black.imageset/Contents.json create mode 100644 Meshtastic/Assets.xcassets/logo-black.imageset/Mesh_Logo_Black.svg create mode 100644 Meshtastic/Assets.xcassets/logo-black.imageset/Mesh_Logo_Black_Large.svg create mode 100644 Meshtastic/Assets.xcassets/logo-black.imageset/Mesh_Logo_Black_Small.svg create mode 100644 Meshtastic/Assets.xcassets/logo-white.imageset/Contents.json create mode 100644 Meshtastic/Assets.xcassets/logo-white.imageset/Mesh_Logo_White.svg create mode 100644 Meshtastic/Assets.xcassets/logo-white.imageset/Mesh_Logo_White_Large.svg create mode 100644 Meshtastic/Assets.xcassets/logo-white.imageset/Mesh_Logo_White_Small.svg create mode 100644 Meshtastic/Views/Helpers/MeshtasticLogo.swift diff --git a/Meshtastic.xcodeproj/project.pbxproj b/Meshtastic.xcodeproj/project.pbxproj index 8bef46b3..b8286954 100644 --- a/Meshtastic.xcodeproj/project.pbxproj +++ b/Meshtastic.xcodeproj/project.pbxproj @@ -64,6 +64,7 @@ DD8ED9C8289CE4B900B3B0AB /* RoutingError.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD8ED9C7289CE4B900B3B0AB /* RoutingError.swift */; }; DD90860E26F69BAE00DC5189 /* NodeMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD90860D26F69BAE00DC5189 /* NodeMap.swift */; }; DD913639270DFF4C00D7ACF3 /* LocalNotificationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD913638270DFF4C00D7ACF3 /* LocalNotificationManager.swift */; }; + DD97E96628EFD9820056DDA4 /* MeshtasticLogo.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD97E96528EFD9820056DDA4 /* MeshtasticLogo.swift */; }; DDA1C48E28DB49D3009933EC /* ChannelRoles.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDA1C48D28DB49D3009933EC /* ChannelRoles.swift */; }; DDA6B2E928419CF2003E8C16 /* MeshPackets.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDA6B2E828419CF2003E8C16 /* MeshPackets.swift */; }; DDA6B2EB28420A7B003E8C16 /* NodeAnnotation.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDA6B2EA28420A7B003E8C16 /* NodeAnnotation.swift */; }; @@ -176,6 +177,7 @@ DD90860A26F645B700DC5189 /* Meshtastic.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Meshtastic.entitlements; sourceTree = ""; }; DD90860D26F69BAE00DC5189 /* NodeMap.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NodeMap.swift; sourceTree = ""; }; DD913638270DFF4C00D7ACF3 /* LocalNotificationManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalNotificationManager.swift; sourceTree = ""; }; + DD97E96528EFD9820056DDA4 /* MeshtasticLogo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MeshtasticLogo.swift; sourceTree = ""; }; DDA1C48D28DB49D3009933EC /* ChannelRoles.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChannelRoles.swift; sourceTree = ""; }; DDA6B2E828419CF2003E8C16 /* MeshPackets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MeshPackets.swift; sourceTree = ""; }; DDA6B2EA28420A7B003E8C16 /* NodeAnnotation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NodeAnnotation.swift; sourceTree = ""; }; @@ -508,6 +510,7 @@ DDD94A4F2845C8F5004A87A0 /* DateTimeText.swift */, DDB6ABDA28B0AC6000384BA1 /* DistanceText.swift */, DD3CC6BD28E4CD9800FA9159 /* BatteryGauge.swift */, + DD97E96528EFD9820056DDA4 /* MeshtasticLogo.swift */, ); path = Helpers; sourceTree = ""; @@ -772,6 +775,7 @@ DD415828285859C4009B0E59 /* TelemetryConfig.swift in Sources */, DD73FD1128750779000852D6 /* PositionLog.swift in Sources */, DD3CC6C028E7A60700FA9159 /* MessagingEnums.swift in Sources */, + DD97E96628EFD9820056DDA4 /* MeshtasticLogo.swift in Sources */, C9697F9D279336B700250207 /* LocalMBTileOverlay.swift in Sources */, DD0F791B28713C8A00A6FDAD /* AdminMessageList.swift in Sources */, DD3CC6BC28E366DF00FA9159 /* Meshtastic.xcdatamodeld in Sources */, diff --git a/Meshtastic/Assets.xcassets/logo-black.imageset/Contents.json b/Meshtastic/Assets.xcassets/logo-black.imageset/Contents.json new file mode 100644 index 00000000..5ef35f53 --- /dev/null +++ b/Meshtastic/Assets.xcassets/logo-black.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Mesh_Logo_Black_Small.svg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Mesh_Logo_Black.svg", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Mesh_Logo_Black_Large.svg", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Meshtastic/Assets.xcassets/logo-black.imageset/Mesh_Logo_Black.svg b/Meshtastic/Assets.xcassets/logo-black.imageset/Mesh_Logo_Black.svg new file mode 100644 index 00000000..e0f9bb19 --- /dev/null +++ b/Meshtastic/Assets.xcassets/logo-black.imageset/Mesh_Logo_Black.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/Meshtastic/Assets.xcassets/logo-black.imageset/Mesh_Logo_Black_Large.svg b/Meshtastic/Assets.xcassets/logo-black.imageset/Mesh_Logo_Black_Large.svg new file mode 100644 index 00000000..a3eec0a0 --- /dev/null +++ b/Meshtastic/Assets.xcassets/logo-black.imageset/Mesh_Logo_Black_Large.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/Meshtastic/Assets.xcassets/logo-black.imageset/Mesh_Logo_Black_Small.svg b/Meshtastic/Assets.xcassets/logo-black.imageset/Mesh_Logo_Black_Small.svg new file mode 100644 index 00000000..b13ff954 --- /dev/null +++ b/Meshtastic/Assets.xcassets/logo-black.imageset/Mesh_Logo_Black_Small.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/Meshtastic/Assets.xcassets/logo-white.imageset/Contents.json b/Meshtastic/Assets.xcassets/logo-white.imageset/Contents.json new file mode 100644 index 00000000..c2d1f573 --- /dev/null +++ b/Meshtastic/Assets.xcassets/logo-white.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Mesh_Logo_White_Small.svg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Mesh_Logo_White.svg", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Mesh_Logo_White_Large.svg", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Meshtastic/Assets.xcassets/logo-white.imageset/Mesh_Logo_White.svg b/Meshtastic/Assets.xcassets/logo-white.imageset/Mesh_Logo_White.svg new file mode 100644 index 00000000..b1bcd575 --- /dev/null +++ b/Meshtastic/Assets.xcassets/logo-white.imageset/Mesh_Logo_White.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/Meshtastic/Assets.xcassets/logo-white.imageset/Mesh_Logo_White_Large.svg b/Meshtastic/Assets.xcassets/logo-white.imageset/Mesh_Logo_White_Large.svg new file mode 100644 index 00000000..517dd23d --- /dev/null +++ b/Meshtastic/Assets.xcassets/logo-white.imageset/Mesh_Logo_White_Large.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/Meshtastic/Assets.xcassets/logo-white.imageset/Mesh_Logo_White_Small.svg b/Meshtastic/Assets.xcassets/logo-white.imageset/Mesh_Logo_White_Small.svg new file mode 100644 index 00000000..fab02c18 --- /dev/null +++ b/Meshtastic/Assets.xcassets/logo-white.imageset/Mesh_Logo_White_Small.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/Meshtastic/Views/Bluetooth/Connect.swift b/Meshtastic/Views/Bluetooth/Connect.swift index b10711d0..a091d4d4 100644 --- a/Meshtastic/Views/Bluetooth/Connect.swift +++ b/Meshtastic/Views/Bluetooth/Connect.swift @@ -254,17 +254,15 @@ struct Connect: View { } .navigationTitle("Bluetooth Radios") - .navigationBarItems(trailing: + + .navigationBarItems(leading: + MeshtasticLogo(), + trailing: - ZStack { - - ConnectedDevice( - bluetoothOn: self.bleManager.isSwitchedOn, - deviceConnected: self.bleManager.connectedPeripheral != nil, - name: (bleManager.connectedPeripheral != nil) ? self.bleManager.connectedPeripheral.shortName : - "????") - } - ) + ZStack { + + ConnectedDevice(bluetoothOn: bleManager.isSwitchedOn, deviceConnected: bleManager.connectedPeripheral != nil, name: (bleManager.connectedPeripheral != nil) ? bleManager.connectedPeripheral.shortName : "????") + }) } .navigationViewStyle(StackNavigationViewStyle()) .sheet(isPresented: $invalidFirmwareVersion, onDismiss: didDismissSheet) { diff --git a/Meshtastic/Views/Helpers/MeshtasticLogo.swift b/Meshtastic/Views/Helpers/MeshtasticLogo.swift new file mode 100644 index 00000000..e632c01e --- /dev/null +++ b/Meshtastic/Views/Helpers/MeshtasticLogo.swift @@ -0,0 +1,22 @@ +// +// MeshtasticLogo.swift +// Meshtastic +// +// Copyright(c) Garth Vander Houwen 10/6/22. +// +import SwiftUI + +struct MeshtasticLogo: View { + + @Environment(\.colorScheme) var colorScheme + + var body: some View { + ZStack { + Image(colorScheme == .dark ? "logo-white" : "logo-black") + .resizable() + .foregroundColor(.red) + .scaledToFit() + } + .padding(.bottom) + } +} diff --git a/Meshtastic/Views/Messages/Contacts.swift b/Meshtastic/Views/Messages/Contacts.swift index 76160113..325ec948 100644 --- a/Meshtastic/Views/Messages/Contacts.swift +++ b/Meshtastic/Views/Messages/Contacts.swift @@ -133,6 +133,9 @@ struct Contacts: View { } .navigationTitle("Contacts") .navigationBarTitleDisplayMode(.inline) + .navigationBarItems(leading: + MeshtasticLogo() + ) } .listStyle(PlainListStyle()) } diff --git a/Meshtastic/Views/Nodes/NodeList.swift b/Meshtastic/Views/Nodes/NodeList.swift index 2ab5327a..dc74e3cd 100644 --- a/Meshtastic/Views/Nodes/NodeList.swift +++ b/Meshtastic/Views/Nodes/NodeList.swift @@ -127,6 +127,9 @@ struct NodeList: View { } } .navigationTitle("All Nodes") + .navigationBarItems(leading: + MeshtasticLogo() + ) .onAppear { if initialLoad { diff --git a/Meshtastic/Views/Nodes/NodeMap.swift b/Meshtastic/Views/Nodes/NodeMap.swift index b8d715e4..22f174cf 100644 --- a/Meshtastic/Views/Nodes/NodeMap.swift +++ b/Meshtastic/Views/Nodes/NodeMap.swift @@ -118,7 +118,8 @@ struct NodeMap: View { .navigationTitle("Mesh Map") .navigationBarTitleDisplayMode(.inline) - .navigationBarItems(trailing: + .navigationBarItems(leading: + MeshtasticLogo(), trailing: ZStack { diff --git a/Meshtastic/Views/Settings/Settings.swift b/Meshtastic/Views/Settings/Settings.swift index ad33e119..5f4e2932 100644 --- a/Meshtastic/Views/Settings/Settings.swift +++ b/Meshtastic/Views/Settings/Settings.swift @@ -218,6 +218,9 @@ struct Settings: View { } .listStyle(GroupedListStyle()) .navigationTitle("Settings") + .navigationBarItems(leading: + MeshtasticLogo() + ) } } }