Skip to content

Commit

Permalink
Merge pull request #2 from po-miyasaka/feature/release-1.0.1
Browse files Browse the repository at this point in the history
Feature/release 1.0.1
  • Loading branch information
po-miyasaka authored Jul 14, 2022
2 parents 16fc5d1 + d5dbf5b commit 3c0a01e
Show file tree
Hide file tree
Showing 19 changed files with 98 additions and 17 deletions.
16 changes: 10 additions & 6 deletions CopyHistory/CopyHistory.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
CEA8AD0E2874C8E3003B6035 /* PasteboardService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PasteboardService.swift; sourceTree = "<group>"; };
CEA8AD132874C8E3003B6035 /* CopyHistory.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = CopyHistory.entitlements; sourceTree = "<group>"; };
CEA8AD362874CAA7003B6035 /* Model.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Model.xcdatamodel; sourceTree = "<group>"; };
D5EDFC3C287BA72300B4507F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -54,12 +55,13 @@
CEA8AD042874C8E1003B6035 /* CopyHistory */ = {
isa = PBXGroup;
children = (
D5EDFC3C287BA72300B4507F /* Info.plist */,
CE11282328774314008144F8 /* AppDelegate.swift */,
CEA8AD0E2874C8E3003B6035 /* PasteboardService.swift */,
CEA8AD072874C8E1003B6035 /* ContentView.swift */,
CEA8AD092874C8E3003B6035 /* Assets.xcassets */,
CEA8AD0E2874C8E3003B6035 /* PasteboardService.swift */,
CEA8AD132874C8E3003B6035 /* CopyHistory.entitlements */,
CEA8AD352874CAA7003B6035 /* Model.xcdatamodeld */,
CE11282328774314008144F8 /* AppDelegate.swift */,
);
path = CopyHistory;
sourceTree = "<group>";
Expand Down Expand Up @@ -264,12 +266,13 @@
CODE_SIGN_ENTITLEMENTS = CopyHistory/CopyHistory.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 6;
DEVELOPMENT_TEAM = H6UU7923NK;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_CFBundleDisplayName = CopyHistory;
INFOPLIST_FILE = CopyHistory/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "Copy History Mark Ⅱ";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
INFOPLIST_KEY_NSHumanReadableCopyright = "";
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -293,12 +296,13 @@
CODE_SIGN_ENTITLEMENTS = CopyHistory/CopyHistory.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 6;
DEVELOPMENT_TEAM = H6UU7923NK;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_CFBundleDisplayName = CopyHistory;
INFOPLIST_FILE = CopyHistory/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "Copy History Mark Ⅱ";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
INFOPLIST_KEY_NSHumanReadableCopyright = "";
LD_RUNPATH_SEARCH_PATHS = (
Expand Down
1 change: 1 addition & 0 deletions CopyHistory/CopyHistory/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ private final class StatusBarController<Content: View> {
popover.performClose(sender)
} else {
popover.show(relativeTo: button.bounds, of: button, preferredEdge: NSRectEdge.minY)
NSApp.activate(ignoringOtherApps: true)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,51 +1,61 @@
{
"images" : [
{
"filename" : "appicon16.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "16x16"
},
{
"filename" : "appicon32 1.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "16x16"
},
{
"filename" : "appicon32.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "32x32"
},
{
"filename" : "appicon64.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "32x32"
},
{
"filename" : "appicon128.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "128x128"
},
{
"filename" : "appicon256 2.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "128x128"
},
{
"filename" : "appicon256 3.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "256x256"
},
{
"filename" : "appicon512 1.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "256x256"
},
{
"filename" : "appicon512 3.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "512x512"
},
{
"filename" : "appicon.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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "display-p3",
"components" : {
"alpha" : "1.000",
"blue" : "0xFF",
"green" : "0xFF",
"red" : "0xFF"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "display-p3",
"components" : {
"alpha" : "1.000",
"blue" : "0x33",
"green" : "0x33",
"red" : "0x33"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "appicon512.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 7 additions & 8 deletions CopyHistory/CopyHistory/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ struct ContentView: View {
isFocus = true
}
HStack {
Button(action: {
NSApplication.shared.terminate(nil)
}, label: {
Image(systemName: "xmark.circle")
})
Spacer()

Button(action: {
Expand All @@ -62,7 +57,7 @@ struct ContentView: View {
.padding(.top, 8)
.padding(.bottom, 16)
}
.background(Color.white)
.background(Color.mainViewBackground)
.alert(
isPresented: $isAlertPresented,
content: {
Expand Down Expand Up @@ -111,13 +106,13 @@ struct Row: View {
.frame(minHeight: 44)
.contentShape(RoundedRectangle(cornerRadius: 20))
})
.buttonStyle(PlainButtonStyle())
.buttonStyle(PlainButtonStyle())
Button(action: {
deleteButtonDidTap(item)
}, label: {
Image(systemName: "trash.fill")
})
.buttonStyle(PlainButtonStyle())
.buttonStyle(PlainButtonStyle())
}
.frame(height: 30)
Divider().padding(EdgeInsets())
Expand All @@ -131,3 +126,7 @@ struct ContentView_Previews: PreviewProvider {
ContentView().environmentObject(PasteboardService.build())
}
}

extension Color {
static var mainViewBackground = Color("mainViewBackground")
}
8 changes: 8 additions & 0 deletions CopyHistory/CopyHistory/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
</dict>
</plist>
6 changes: 3 additions & 3 deletions CopyHistory/CopyHistory/PasteboardService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ final class PasteboardService: ObservableObject {
latestChangeCount = pasteBoard.changeCount

guard let newItem = pasteBoard.pasteboardItems?.first,
let type = newItem.availableType(from: newItem.types),
let data = newItem.data(forType: type) else { return }
let type = newItem.availableType(from: newItem.types),
let data = newItem.data(forType: type) else { return }
let dataHash = CryptoKit.SHA256.hash(data: data).description

if let alreadySavedItem = persistenceController.getCopiedItem(from: dataHash) {
Expand Down Expand Up @@ -74,7 +74,7 @@ final class PasteboardService: ObservableObject {

func didSelected(_ copiedItem: CopiedItem) {
guard let contentTypeString = copiedItem.contentTypeString,
let contentData = copiedItem.content
let contentData = copiedItem.content
else { return }
let type = NSPasteboard.PasteboardType(contentTypeString)
let item = NSPasteboardItem()
Expand Down

0 comments on commit 3c0a01e

Please sign in to comment.