Skip to content

Commit d79d506

Browse files
committed
add retina and dark mode support, v0.1.4
1 parent 5c0b66f commit d79d506

File tree

11 files changed

+43
-48
lines changed

11 files changed

+43
-48
lines changed

BateryProlonger.xcodeproj/project.pbxproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
269BD72017FB50AD0045D9B4 /* icon-small.png in Resources */ = {isa = PBXBuildFile; fileRef = 269BD71F17FB50AD0045D9B4 /* icon-small.png */; };
2929
269BD72417FB5FBD0045D9B4 /* battery.iconset in Resources */ = {isa = PBXBuildFile; fileRef = 269BD72317FB5FBD0045D9B4 /* battery.iconset */; };
3030
269BD72617FB6F190045D9B4 /* .gitignore in Resources */ = {isa = PBXBuildFile; fileRef = 269BD72517FB6F190045D9B4 /* .gitignore */; };
31+
26F35D8219F7B2DD00B07A6E /* icon-small@x2.png in Resources */ = {isa = PBXBuildFile; fileRef = 26F35D8119F7B2DD00B07A6E /* icon-small@x2.png */; };
3132
C69F2E9518E61B3400312792 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C69F2E9418E61B3400312792 /* Images.xcassets */; };
3233
/* End PBXBuildFile section */
3334

@@ -85,6 +86,7 @@
8586
269BD71F17FB50AD0045D9B4 /* icon-small.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon-small.png"; sourceTree = "<group>"; };
8687
269BD72317FB5FBD0045D9B4 /* battery.iconset */ = {isa = PBXFileReference; lastKnownFileType = folder.iconset; path = battery.iconset; sourceTree = "<group>"; };
8788
269BD72517FB6F190045D9B4 /* .gitignore */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .gitignore; sourceTree = "<group>"; };
89+
26F35D8119F7B2DD00B07A6E /* icon-small@x2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon-small@x2.png"; sourceTree = "<group>"; };
8890
C69F2E9418E61B3400312792 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
8991
/* End PBXFileReference section */
9092

@@ -159,6 +161,7 @@
159161
children = (
160162
269BD72317FB5FBD0045D9B4 /* battery.iconset */,
161163
269BD71F17FB50AD0045D9B4 /* icon-small.png */,
164+
26F35D8119F7B2DD00B07A6E /* icon-small@x2.png */,
162165
269BD71617FB44400045D9B4 /* About.xib */,
163166
269BD71817FB44670045D9B4 /* AboutController.h */,
164167
269BD71917FB44670045D9B4 /* AboutController.m */,
@@ -243,7 +246,7 @@
243246
name = BateryProlongerTests;
244247
productName = BateryProlongerTests;
245248
productReference = 2619223C17FA0AAD0062FC1D /* BateryProlongerTests.octest */;
246-
productType = "com.apple.product-type.bundle";
249+
productType = "com.apple.product-type.bundle.ocunit-test";
247250
};
248251
/* End PBXNativeTarget section */
249252

@@ -283,6 +286,7 @@
283286
2619223017FA0AAC0062FC1D /* Credits.rtf in Resources */,
284287
2619223617FA0AAC0062FC1D /* MainMenu.xib in Resources */,
285288
269BD71717FB44400045D9B4 /* About.xib in Resources */,
289+
26F35D8219F7B2DD00B07A6E /* icon-small@x2.png in Resources */,
286290
269BD72017FB50AD0045D9B4 /* icon-small.png in Resources */,
287291
269BD72417FB5FBD0045D9B4 /* battery.iconset in Resources */,
288292
269BD72617FB6F190045D9B4 /* .gitignore in Resources */,

BateryProlonger.xcodeproj/project.xcworkspace/xcshareddata/BateryProlonger.xccheckout

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,34 @@
1212
<dict>
1313
<key>7480BF4A-8272-4742-A3CF-EE8F4E5EA36E</key>
1414
<string>https://github.com/skfd/Battery-Prolonger.git</string>
15+
<key>90D53E52F69661826D440C4F92A99395750984DE</key>
16+
<string>https://github.com/orthes/Battery-Prolonger.git</string>
1517
</dict>
1618
<key>IDESourceControlProjectPath</key>
17-
<string>BateryProlonger.xcodeproj/project.xcworkspace</string>
19+
<string>BateryProlonger.xcodeproj</string>
1820
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
1921
<dict>
2022
<key>7480BF4A-8272-4742-A3CF-EE8F4E5EA36E</key>
23+
<string>../../../Battery-Prolonger</string>
24+
<key>90D53E52F69661826D440C4F92A99395750984DE</key>
2125
<string>../..</string>
2226
</dict>
2327
<key>IDESourceControlProjectURL</key>
24-
<string>https://github.com/skfd/Battery-Prolonger.git</string>
28+
<string>https://github.com/orthes/Battery-Prolonger.git</string>
2529
<key>IDESourceControlProjectVersion</key>
26-
<integer>110</integer>
30+
<integer>111</integer>
2731
<key>IDESourceControlProjectWCCIdentifier</key>
28-
<string>7480BF4A-8272-4742-A3CF-EE8F4E5EA36E</string>
32+
<string>90D53E52F69661826D440C4F92A99395750984DE</string>
2933
<key>IDESourceControlProjectWCConfigurations</key>
3034
<array>
35+
<dict>
36+
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
37+
<string>public.vcs.git</string>
38+
<key>IDESourceControlWCCIdentifierKey</key>
39+
<string>90D53E52F69661826D440C4F92A99395750984DE</string>
40+
<key>IDESourceControlWCCName</key>
41+
<string>BateryProlonger</string>
42+
</dict>
3143
<dict>
3244
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
3345
<string>public.vcs.git</string>

BateryProlonger/About.xib

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="4514" systemVersion="13A603" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
2+
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6245" systemVersion="14A389" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
33
<dependencies>
44
<deployment defaultVersion="1070" identifier="macosx"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="4514"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6245"/>
66
</dependencies>
77
<objects>
88
<customObject id="-2" userLabel="File's Owner" customClass="AboutController">
@@ -11,42 +11,39 @@
1111
</connections>
1212
</customObject>
1313
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
14-
<customObject id="-3" userLabel="Application"/>
15-
<window title="About" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" wantsToBeColor="NO" animationBehavior="default" id="1">
14+
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
15+
<window title="About" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" animationBehavior="default" id="1">
1616
<windowStyleMask key="styleMask" titled="YES" closable="YES"/>
1717
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
1818
<rect key="contentRect" x="196" y="240" width="488" height="408"/>
19-
<rect key="screenRect" x="0.0" y="0.0" width="1280" height="800"/>
19+
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1080"/>
2020
<view key="contentView" id="2">
2121
<rect key="frame" x="0.0" y="0.0" width="488" height="408"/>
2222
<autoresizingMask key="autoresizingMask"/>
2323
<subviews>
24-
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="4">
24+
<textField verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="4">
2525
<rect key="frame" x="160" y="360" width="168" height="22"/>
26-
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
2726
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Battery Prolonger" id="5">
2827
<font key="font" metaFont="systemBold" size="18"/>
2928
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
3029
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
3130
</textFieldCell>
3231
</textField>
33-
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="11">
32+
<textField verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="11">
3433
<rect key="frame" x="111" y="243" width="266" height="68"/>
35-
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
3634
<constraints>
3735
<constraint firstAttribute="height" constant="68" id="74"/>
3836
</constraints>
3937
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" sendsActionOnEndEditing="YES" alignment="left" id="12">
4038
<font key="font" metaFont="system"/>
41-
<string key="title">Version: 0.1.3-alpha
Author: Pavel Linkesch
42-
@linkesch | www.linkesch.sk</string>
39+
<string key="title">Version: 0.1.4
Author: Pavel Linkesch
40+
@linkesch | www.linkesch.sk</string>
4341
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
4442
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
4543
</textFieldCell>
4644
</textField>
47-
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="17">
45+
<textField verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="17">
4846
<rect key="frame" x="108" y="335" width="272" height="17"/>
49-
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
5047
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" sendsActionOnEndEditing="YES" alignment="center" title="http://orthes.github.io/Battery-Prolonger" id="18">
5148
<font key="font" metaFont="system"/>
5249
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@@ -55,7 +52,6 @@
5552
</textField>
5653
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="51">
5754
<rect key="frame" x="20" y="45" width="448" height="192"/>
58-
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
5955
<constraints>
6056
<constraint firstAttribute="height" constant="192" id="64"/>
6157
</constraints>
@@ -70,9 +66,8 @@ http://www.wired.com/gadgetlab/2013/09/laptop-battery</string>
7066
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
7167
</textFieldCell>
7268
</textField>
73-
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="67">
69+
<textField verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="67">
7470
<rect key="frame" x="18" y="20" width="448" height="17"/>
75-
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
7671
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" sendsActionOnEndEditing="YES" title="Icons by http://www.visualpharm.com and http://www.iconshock.com" id="68">
7772
<font key="font" metaFont="system"/>
7873
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@@ -96,4 +91,4 @@ http://www.wired.com/gadgetlab/2013/09/laptop-battery</string>
9691
</view>
9792
</window>
9893
</objects>
99-
</document>
94+
</document>

BateryProlonger/AppDelegate.m

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,12 @@ - (void)awakeFromNib
2727
{
2828
statusItem = [[[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength] retain];
2929

30-
NSImage* icon = [NSImage imageNamed:@"StatusbarIcon"];
31-
NSImage *highlightIcon = [NSImage imageNamed:@"StatusbarIcon"];
32-
[highlightIcon setTemplate:YES];
33-
30+
NSBundle *bundle = [NSBundle mainBundle];
31+
NSImage* icon = [[NSImage alloc] initWithContentsOfFile:[bundle pathForResource:@"icon-small" ofType:@"png"]];
32+
[icon setTemplate:YES];
33+
3434
[statusItem setImage:icon];
35-
[statusItem setAlternateImage:icon];
3635
[statusItem setMenu:statusMenu];
37-
[statusItem setHighlightMode:YES];
38-
3936

4037
[self refresh:NULL];
4138

BateryProlonger/Images.xcassets/StatusbarIcon.imageset/Contents.json

Lines changed: 0 additions & 18 deletions
This file was deleted.
Binary file not shown.
Binary file not shown.

BateryProlonger/icon-small.png

-940 Bytes
Loading

BateryProlonger/icon-small@x2.png

-794 Bytes
Loading

0 commit comments

Comments
 (0)