Skip to content

Commit

Permalink
Added the new icons
Browse files Browse the repository at this point in the history
  • Loading branch information
cs4alhaider committed Jul 20, 2021
1 parent fcf8e52 commit 939a1ee
Show file tree
Hide file tree
Showing 17 changed files with 43 additions and 16 deletions.
6 changes: 4 additions & 2 deletions QRCodeHere.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_ASSET_PATHS = "\"QRCodeHere/Preview Content\"";
DEVELOPMENT_TEAM = G69L3HCQBT;
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -531,6 +531,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 1.0.1;
PRODUCT_BUNDLE_IDENTIFIER = net.alhaider.QRCodeHere;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand All @@ -545,7 +546,7 @@
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_ASSET_PATHS = "\"QRCodeHere/Preview Content\"";
DEVELOPMENT_TEAM = G69L3HCQBT;
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -556,6 +557,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 1.0.1;
PRODUCT_BUNDLE_IDENTIFIER = net.alhaider.QRCodeHere;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand Down
9 changes: 8 additions & 1 deletion QRCodeHere/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,16 @@ class AppDelegate: NSObject, NSApplicationDelegate {
let statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)

func applicationDidFinishLaunching(_ aNotification: Notification) {
statusItem.button?.title = "􀖂"
statusItem.button?.target = self
statusItem.button?.action = #selector(showView)
guard let logo = NSImage(named: NSImage.Name("status-icon")) else { return }

let resizedLogo = NSImage(size: NSSize(width: 18, height: 18), flipped: false) { (dstRect) -> Bool in
logo.draw(in: dstRect)
return true
}
resizedLogo.isTemplate = true
statusItem.button?.image = resizedLogo
}

@objc func showView() {
Expand Down
Binary file modified QRCodeHere/Assets.xcassets/AppIcon.appiconset/Icon '1024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified QRCodeHere/Assets.xcassets/AppIcon.appiconset/Icon '128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified QRCodeHere/Assets.xcassets/AppIcon.appiconset/Icon '16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified QRCodeHere/Assets.xcassets/AppIcon.appiconset/Icon '256-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified QRCodeHere/Assets.xcassets/AppIcon.appiconset/Icon '256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified QRCodeHere/Assets.xcassets/AppIcon.appiconset/Icon '32-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified QRCodeHere/Assets.xcassets/AppIcon.appiconset/Icon '32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified QRCodeHere/Assets.xcassets/AppIcon.appiconset/Icon '512-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified QRCodeHere/Assets.xcassets/AppIcon.appiconset/Icon '512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified QRCodeHere/Assets.xcassets/AppIcon.appiconset/Icon '64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions QRCodeHere/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}
21 changes: 21 additions & 0 deletions QRCodeHere/Assets.xcassets/status-icon.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "status-icon.pdf",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
15 changes: 6 additions & 9 deletions QRCodeHere/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,12 @@ struct ContentView: View {

var watermarkView: some View {
Section {
if !addWatermark {
Button("Add watermark") {
toggleWatermark()
}
} else {
HStack {
TextField("Enter your watermark here", text: $watermark.onChange(saveWatermarkContent))
Button("Cancle") {
HStack {
TextField("Enter your watermark here", text: $watermark.onChange(saveWatermarkContent))
if !watermark.isEmpty {
Button("Remove watermark") {
watermark = ""
toggleWatermark()
saveWatermarkContent("")
}
}
}
Expand Down Expand Up @@ -142,6 +138,7 @@ struct ContentView: View {

if let watermarkContent = defaults.value(forKey: .watermarkContent) as? String {
watermark = watermarkContent
addWatermark = false
}
}

Expand Down
2 changes: 1 addition & 1 deletion QRCodeHere/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSApplicationCategoryType</key>
Expand Down

0 comments on commit 939a1ee

Please sign in to comment.