Skip to content

Commit

Permalink
Added new icon, improved first launch screen
Browse files Browse the repository at this point in the history
  • Loading branch information
buresdv committed Oct 10, 2022
1 parent 52b2218 commit 4cf4e93
Show file tree
Hide file tree
Showing 23 changed files with 44 additions and 23 deletions.
2 changes: 2 additions & 0 deletions TBX Scope.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
CODE_SIGN_ENTITLEMENTS = "TBX Scope/TBX_Scope.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
Expand Down Expand Up @@ -364,6 +365,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
CODE_SIGN_ENTITLEMENTS = "TBX Scope/TBX_Scope.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
Expand Down
Binary file not shown.
Binary file removed TBX Scope/Assets.xcassets/AppIcon.appiconset/128.png
Binary file not shown.
Binary file removed TBX Scope/Assets.xcassets/AppIcon.appiconset/16.png
Binary file not shown.
Binary file not shown.
Binary file removed TBX Scope/Assets.xcassets/AppIcon.appiconset/256.png
Binary file not shown.
Binary file not shown.
Binary file removed TBX Scope/Assets.xcassets/AppIcon.appiconset/32.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed TBX Scope/Assets.xcassets/AppIcon.appiconset/64.png
Binary file not shown.
20 changes: 10 additions & 10 deletions TBX Scope/Assets.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
@@ -1,61 +1,61 @@
{
"images" : [
{
"filename" : "16.png",
"filename" : "Icon-16.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "16x16"
},
{
"filename" : "32 1.png",
"filename" : "Icon-32.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "16x16"
},
{
"filename" : "32.png",
"filename" : "Icon-32 1.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "32x32"
},
{
"filename" : "64.png",
"filename" : "Icon-64.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "32x32"
},
{
"filename" : "128.png",
"filename" : "Icon-128.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "128x128"
},
{
"filename" : "256 1.png",
"filename" : "Icon-256.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "128x128"
},
{
"filename" : "256.png",
"filename" : "Icon-256 1.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "256x256"
},
{
"filename" : "512 1.png",
"filename" : "Icon-512.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "256x256"
},
{
"filename" : "512.png",
"filename" : "Icon-512 1.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "512x512"
},
{
"filename" : "1024.png",
"filename" : "Icon-1024.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.
45 changes: 32 additions & 13 deletions TBX Scope/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,37 @@ struct ContentView: View {
VStack {
switch appState.loading {
case .ready:
Text("Ready to load")
VStack {
Text("Select TBX File to Load")
.foregroundColor(Color(nsColor: NSColor.lightGray))
.font(.title)

// TODO: This is code duplication fix it!
Button {
do {
selectedFile = try selectFile()
Task {
do {
appState.loading = .loading
let contentsOfTBX: String = try await loadContentsOfFile(path: selectedFile!)


parsedTBX.contents = try! parseXML(from: contentsOfTBX)

appState.loading = .finished
} catch let error as NSError {
print("Failed while reading file: \(error)")
}
}
} catch let error as NSError {
print(error)
}
} label: {
Text("Open TBX File")

}
.keyboardShortcut("o", modifiers: [.command])
}

case .loading:
ProgressView("Loading")
Expand Down Expand Up @@ -57,7 +87,7 @@ struct ContentView: View {
}
}
}
.frame(minWidth: 400, minHeight: 200)
.frame(minWidth: 600, minHeight: 400)
.toolbar {
ToolbarItemGroup(placement: .primaryAction) {
Button {
Expand Down Expand Up @@ -102,15 +132,4 @@ struct ContentView: View {
.navigationSubtitle("\(parsedTBX.contents.terms.count == 1 ? 0 : parsedTBX.contents.terms.count) items loaded")
}

/*
var searchResults: ParsedTBX {
if searchString.isEmpty {
return parsedTBX
} else {
return $parsedTBX.filter {
$0.contains(searchString)
}
}
}
*/
}

0 comments on commit 4cf4e93

Please sign in to comment.