App-Icon hinzugefügt.

This commit is contained in:
Gerrit Linnemann 2013-10-31 14:44:16 +01:00
parent 3feb29da29
commit 7948e1afc9
28 changed files with 124 additions and 9 deletions

View File

@ -9,6 +9,8 @@
/* Begin PBXBuildFile section */
ECB32E3718210D1D00D3C886 /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = ECB32E3618210D1D00D3C886 /* Reachability.m */; };
ECB32E3918210F3A00D3C886 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ECB32E3818210F3A00D3C886 /* SystemConfiguration.framework */; };
ECB963CC18228F42006F370E /* statusbar-icon.png in Resources */ = {isa = PBXBuildFile; fileRef = ECB963CB18228F42006F370E /* statusbar-icon.png */; };
ECB963D01822943E006F370E /* ImageHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = ECB963CF1822943E006F370E /* ImageHelper.m */; };
ECE5811B181A77090066D073 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ECE5811A181A77090066D073 /* Cocoa.framework */; };
ECE58125181A77090066D073 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = ECE58123181A77090066D073 /* InfoPlist.strings */; };
ECE58127181A77090066D073 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = ECE58126181A77090066D073 /* main.m */; };
@ -38,6 +40,9 @@
ECB32E3518210D1D00D3C886 /* Reachability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Reachability.h; sourceTree = "<group>"; };
ECB32E3618210D1D00D3C886 /* Reachability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Reachability.m; sourceTree = "<group>"; };
ECB32E3818210F3A00D3C886 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
ECB963CB18228F42006F370E /* statusbar-icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "statusbar-icon.png"; sourceTree = "<group>"; };
ECB963CE1822943E006F370E /* ImageHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageHelper.h; sourceTree = "<group>"; };
ECB963CF1822943E006F370E /* ImageHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImageHelper.m; sourceTree = "<group>"; };
ECE58117181A77090066D073 /* ipbc-Client.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ipbc-Client.app"; sourceTree = BUILT_PRODUCTS_DIR; };
ECE5811A181A77090066D073 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
ECE5811D181A77090066D073 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
@ -85,6 +90,23 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
ECB963CA18228F29006F370E /* images */ = {
isa = PBXGroup;
children = (
ECB963CB18228F42006F370E /* statusbar-icon.png */,
);
name = images;
sourceTree = "<group>";
};
ECB963CD18229423006F370E /* Helper */ = {
isa = PBXGroup;
children = (
ECB963CE1822943E006F370E /* ImageHelper.h */,
ECB963CF1822943E006F370E /* ImageHelper.m */,
);
name = Helper;
sourceTree = "<group>";
};
ECE5810E181A77090066D073 = {
isa = PBXGroup;
children = (
@ -128,6 +150,8 @@
ECE58120181A77090066D073 /* ipbc-Client */ = {
isa = PBXGroup;
children = (
ECB963CD18229423006F370E /* Helper */,
ECB963CA18228F29006F370E /* images */,
ECE6FED7181E8B1C004F6C1F /* WebService */,
ECE5812C181A77090066D073 /* ipbcAppDelegate.h */,
ECE5812D181A77090066D073 /* ipbcAppDelegate.m */,
@ -263,6 +287,7 @@
files = (
ECE58125181A77090066D073 /* InfoPlist.strings in Resources */,
ECE58133181A77090066D073 /* Images.xcassets in Resources */,
ECB963CC18228F42006F370E /* statusbar-icon.png in Resources */,
ECE5812B181A77090066D073 /* Credits.rtf in Resources */,
ECE58131181A77090066D073 /* MainMenu.xib in Resources */,
);
@ -286,6 +311,7 @@
ECE6FEDA181E8BE4004F6C1F /* WebServiceConstants.m in Sources */,
ECE5812E181A77090066D073 /* ipbcAppDelegate.m in Sources */,
ECE58127181A77090066D073 /* main.m in Sources */,
ECB963D01822943E006F370E /* ImageHelper.m in Sources */,
ECE6FED6181E8AFE004F6C1F /* WebserviceClient.m in Sources */,
ECB32E3718210D1D00D3C886 /* Reachability.m in Sources */,
);

View File

@ -0,0 +1,15 @@
//
// ImageHelper.h
// ipbc-Client
//
// Created by Gerrit Linnemann on 31.10.13.
// Copyright (c) 2013 Adawim UG (haftungsbeschränkt). All rights reserved.
//
#import <Foundation/Foundation.h>
@interface ImageHelper : NSObject
+(NSImage*)resizeImage:(NSImage*)sourceImage size:(NSSize)size;
@end

View File

@ -0,0 +1,30 @@
//
// ImageHelper.m
// ipbc-Client
//
// Created by Gerrit Linnemann on 31.10.13.
// Copyright (c) 2013 Adawim UG (haftungsbeschränkt). All rights reserved.
//
#import "ImageHelper.h"
@implementation ImageHelper
+(NSImage*)resizeImage:(NSImage*)sourceImage size:(NSSize)size {
NSRect targetFrame = NSMakeRect(0, 0, size.width, size.height);
NSImage* targetImage = nil;
NSImageRep *sourceImageRep =
[sourceImage bestRepresentationForRect:targetFrame
context:nil
hints:nil];
targetImage = [[NSImage alloc] initWithSize:size];
[targetImage lockFocus];
[sourceImageRep drawInRect: targetFrame];
[targetImage unlockFocus];
return targetImage;
}
@end

View File

@ -1,13 +1,15 @@
{
"images" : [
{
"idiom" : "mac",
"size" : "16x16",
"idiom" : "mac",
"filename" : "icon_16x16.png",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "16x16",
"idiom" : "mac",
"filename" : "icon_16x16@2x.png",
"scale" : "2x"
},
{
@ -16,28 +18,33 @@
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "32x32",
"idiom" : "mac",
"filename" : "icon_32x32@2x.png",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "128x128",
"idiom" : "mac",
"filename" : "icon_128x128.png",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "128x128",
"idiom" : "mac",
"filename" : "icon_128x128@2x.png",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "256x256",
"idiom" : "mac",
"filename" : "icon_256x256.png",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "256x256",
"idiom" : "mac",
"filename" : "icon_256x256@2x.png",
"scale" : "2x"
},
{
@ -46,8 +53,9 @@
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "512x512",
"idiom" : "mac",
"filename" : "icon_512x512@2x.png",
"scale" : "2x"
}
],

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

View File

@ -7,6 +7,7 @@
//
#import "ipbcAppDelegate.h"
#import "ImageHelper.h"
@implementation ipbcAppDelegate
@ -23,8 +24,13 @@
-(void)awakeFromNib {
statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength];
[statusItem setMenu:statusMenu];
[statusItem setTitle:@"ip-bc"];
[statusItem setHighlightMode:YES];
// statusbar icon
NSSize statusbarIconSize;
statusbarIconSize.width = 18;
statusbarIconSize.height = 18;
[statusItem setImage:[ImageHelper resizeImage:[NSImage imageNamed: @"statusbar-icon.png"] size:statusbarIconSize]];
}
-(IBAction)fromMenuSettings:(id)sender {

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@ -0,0 +1,30 @@
{\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf390
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\paperw11900\paperh16840\margl1440\margr1440\vieww11860\viewh13740\viewkind0
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural
\f0\b\fs30 \cf0 Installing icon files in an app using Xcode 5+ and Image Assets:\
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural
\b0\fs28 \cf0 \
Open your Mac app project in Xcode 5 or later.\
Make sure the Project Navigator is visible in the left sidebar.\
\
Select "Images.xcassets" in the Project Navigator.\
\
If the project was created using an easier version of Xcode, this may not appear.\
To create it, select the project at the top of the Project Navigator.\
Use the popup menu to make sure you are editing the target and go to the General tab.\
In the "App Icons" section, click the "Use Asset Catalog" button.\
The "Images.xcassets" folder will be created and any existing icons will be migrated to the new structure.\
\
In "Images.xcassets", select "AppIcon" which will show you a series of image wells listing the icons needed for the project and its supported devices.\
If you do not see any wells, click the "Show Overview" button at the bottom right of the pane.\
\
Select all the files starting with "icon_" and drag them into these image wells.\
In the early versions of Xcode 5, I have found that this does not always allocate them all.\
Some icon files may be marked as "Unassigned". If so, drag them into the appropriate image wells manually. The file names indicate which icons fit into which section.\
\
Once all the icons have been dragged into place, you can delete this folder and all the files in it.\
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

BIN
ipbc-icon.icns Normal file

Binary file not shown.

BIN
ipbc-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB