Skip to content

Commit

Permalink
Add app icon
Browse files Browse the repository at this point in the history
  • Loading branch information
aheze committed Sep 9, 2021
1 parent 02bd2c7 commit d405811
Show file tree
Hide file tree
Showing 17 changed files with 251 additions and 193 deletions.
2 changes: 1 addition & 1 deletion Shared/Assets.xcassets/AccentColor.colorset/Contents.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"alpha" : "1.000",
"blue" : "1.000",
"green" : "0.000",
"red" : "0.893"
"red" : "0.894"
}
},
"idiom" : "universal"
Expand Down
10 changes: 10 additions & 0 deletions Shared/Assets.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,51 +91,61 @@
"size" : "1024x1024"
},
{
"filename" : "icon_16x16.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "16x16"
},
{
"filename" : "icon_16x16@2x@2x.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "16x16"
},
{
"filename" : "icon_32x32.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "32x32"
},
{
"filename" : "icon_32x32@2x@2x.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "32x32"
},
{
"filename" : "icon_128x128.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "128x128"
},
{
"filename" : "icon_128x128@2x@2x.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "128x128"
},
{
"filename" : "icon_256x256.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "256x256"
},
{
"filename" : "icon_256x256@2x@2x.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "256x256"
},
{
"filename" : "icon_512x512.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "512x512"
},
{
"filename" : "icon_512x512@2x@2x.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "512x512"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 20 additions & 13 deletions Shared/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,31 @@ import SwiftUI

struct ContentView: View {

@AppStorage("stitchesText") var stitchesText: String = "inc=2,sc=1"
@AppStorage("stitchesText") var stitchesText: String = "inc=2,sc=1,sc[0-9]tog=1,dec=2,sl st=1,hdc=1,dc=1,fsc=1"
@StateObject var settings = Settings()
@State var selectedTab: Int? = 0

var body: some View {
#if os(macOS)
NavigationView {
List(selection: $selectedTab) {
NavigationLink(destination: CounterView(regex: $settings.regex)) {

NavigationLink(destination: CounterView(regex: $settings.regex), tag: 0, selection: $selectedTab) {
Label("Counter", systemImage: "number")
.font(.system(size: 17, weight: .medium))
.accentColor(Color("AccentColor"))
.accentColor(Color.accentColor)
}
.padding(EdgeInsets(top: 6, leading: 0, bottom: 6, trailing: 0))
.tag(0)


NavigationLink(destination: SettingsView(settings: settings, stitchesText: $stitchesText)) {
NavigationLink(destination: SettingsView(settings: settings, stitchesText: $stitchesText), tag: 1, selection: $selectedTab) {
Label("Settings", systemImage: "gearshape")
.font(.system(size: 17, weight: .medium))
.accentColor(Color("AccentColor"))
.accentColor(Color.accentColor)
}
.padding(EdgeInsets(top: 6, leading: 0, bottom: 6, trailing: 0))
.tag(1)
}

.listStyle(SidebarListStyle())
Expand All @@ -48,21 +48,28 @@ struct ContentView: View {
}
.frame(minWidth: 500, idealWidth: 500, maxWidth: 700, minHeight: 300, idealHeight: 600, maxHeight: 800)
.onAppear {
print("apear!")
settings.readAppStorage(stitchesText: stitchesText)
stitchesText = settings.getStitchesText()
}

#else
TabView {
CounterView(regex: $settings.regex)
.tabItem {
Label("Counter", systemImage: "number")
}
NavigationView {
CounterView(regex: $settings.regex)
.navigationTitle("Counter")
}
.tabItem {
Label("Counter", systemImage: "number")
}

SettingsView(settings: settings, stitchesText: $stitchesText)
.tabItem {
Label("Settings", systemImage: "gearshape")
}
NavigationView {
SettingsView(settings: settings, stitchesText: $stitchesText)
.navigationTitle("Settings")
}
.tabItem {
Label("Settings", systemImage: "gearshape")
}
}
.onAppear {
settings.readAppStorage(stitchesText: stitchesText)
Expand Down
Loading

0 comments on commit d405811

Please sign in to comment.