Skip to content

Commit ebbecd4

Browse files
committed
Fix fontSize at 24, Use Monospace System Font on Catalina and Release 2.1.3
1 parent ddc32c8 commit ebbecd4

4 files changed

Lines changed: 31 additions & 37 deletions

File tree

DeveloperExcuses.xcodeproj/project.pbxproj

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,11 @@
1414
077BC2B11DA22D14007DE060 /* DeveloperExcusesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 077BC2B01DA22D14007DE060 /* DeveloperExcusesView.swift */; };
1515
07B5E452218645D50005E36F /* OnelinerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07B5E451218645D50005E36F /* OnelinerView.swift */; };
1616
07B5E459218645DF0005E36F /* String+Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07B5E454218645DF0005E36F /* String+Constants.swift */; };
17-
07B5E45A218645DF0005E36F /* NSTextField+Label.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07B5E455218645DF0005E36F /* NSTextField+Label.swift */; };
1817
07B5E45B218645DF0005E36F /* UserDefaults+LastLine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07B5E456218645DF0005E36F /* UserDefaults+LastLine.swift */; };
1918
07B5E45C218645DF0005E36F /* Date+FetchInterval.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07B5E457218645DF0005E36F /* Date+FetchInterval.swift */; };
2019
07B5E45D218645DF0005E36F /* TimeInterval+FetchInterval.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07B5E458218645DF0005E36F /* TimeInterval+FetchInterval.swift */; };
2120
07F22F0623EEE67400F939BF /* OnelinerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07B5E451218645D50005E36F /* OnelinerView.swift */; };
2221
07F22F0723EEE68000F939BF /* String+Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07B5E454218645DF0005E36F /* String+Constants.swift */; };
23-
07F22F0823EEE68000F939BF /* NSTextField+Label.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07B5E455218645DF0005E36F /* NSTextField+Label.swift */; };
2422
07F22F0923EEE68000F939BF /* UserDefaults+LastLine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07B5E456218645DF0005E36F /* UserDefaults+LastLine.swift */; };
2523
07F22F0A23EEE68000F939BF /* Date+FetchInterval.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07B5E457218645DF0005E36F /* Date+FetchInterval.swift */; };
2624
07F22F0B23EEE68000F939BF /* TimeInterval+FetchInterval.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07B5E458218645DF0005E36F /* TimeInterval+FetchInterval.swift */; };
@@ -54,7 +52,6 @@
5452
077BC2B01DA22D14007DE060 /* DeveloperExcusesView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeveloperExcusesView.swift; sourceTree = "<group>"; };
5553
07B5E451218645D50005E36F /* OnelinerView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OnelinerView.swift; sourceTree = "<group>"; };
5654
07B5E454218645DF0005E36F /* String+Constants.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+Constants.swift"; sourceTree = "<group>"; };
57-
07B5E455218645DF0005E36F /* NSTextField+Label.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSTextField+Label.swift"; sourceTree = "<group>"; };
5855
07B5E456218645DF0005E36F /* UserDefaults+LastLine.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UserDefaults+LastLine.swift"; sourceTree = "<group>"; };
5956
07B5E457218645DF0005E36F /* Date+FetchInterval.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Date+FetchInterval.swift"; sourceTree = "<group>"; };
6057
07B5E458218645DF0005E36F /* TimeInterval+FetchInterval.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "TimeInterval+FetchInterval.swift"; sourceTree = "<group>"; };
@@ -114,7 +111,6 @@
114111
isa = PBXGroup;
115112
children = (
116113
07B5E454218645DF0005E36F /* String+Constants.swift */,
117-
07B5E455218645DF0005E36F /* NSTextField+Label.swift */,
118114
07B5E456218645DF0005E36F /* UserDefaults+LastLine.swift */,
119115
07B5E457218645DF0005E36F /* Date+FetchInterval.swift */,
120116
07B5E458218645DF0005E36F /* TimeInterval+FetchInterval.swift */,
@@ -313,7 +309,6 @@
313309
isa = PBXSourcesBuildPhase;
314310
buildActionMask = 2147483647;
315311
files = (
316-
07F22F0823EEE68000F939BF /* NSTextField+Label.swift in Sources */,
317312
07F22F0723EEE68000F939BF /* String+Constants.swift in Sources */,
318313
07F22F0B23EEE68000F939BF /* TimeInterval+FetchInterval.swift in Sources */,
319314
07F22F0923EEE68000F939BF /* UserDefaults+LastLine.swift in Sources */,
@@ -334,7 +329,6 @@
334329
07B5E45C218645DF0005E36F /* Date+FetchInterval.swift in Sources */,
335330
07B5E459218645DF0005E36F /* String+Constants.swift in Sources */,
336331
07B5E45D218645DF0005E36F /* TimeInterval+FetchInterval.swift in Sources */,
337-
07B5E45A218645DF0005E36F /* NSTextField+Label.swift in Sources */,
338332
);
339333
runOnlyForDeploymentPostprocessing = 0;
340334
};
@@ -462,7 +456,7 @@
462456
GCC_WARN_UNINITIALIZED_AUTOS = YES;
463457
GCC_WARN_UNUSED_FUNCTION = YES;
464458
GCC_WARN_UNUSED_VARIABLE = YES;
465-
MACOSX_DEPLOYMENT_TARGET = 10.9;
459+
MACOSX_DEPLOYMENT_TARGET = 10.11;
466460
ONLY_ACTIVE_ARCH = YES;
467461
SDKROOT = macosx;
468462
SWIFT_INSTALL_OBJC_HEADER = NO;
@@ -503,7 +497,7 @@
503497
GCC_WARN_UNINITIALIZED_AUTOS = YES;
504498
GCC_WARN_UNUSED_FUNCTION = YES;
505499
GCC_WARN_UNUSED_VARIABLE = YES;
506-
MACOSX_DEPLOYMENT_TARGET = 10.9;
500+
MACOSX_DEPLOYMENT_TARGET = 10.11;
507501
SDKROOT = macosx;
508502
SWIFT_INSTALL_OBJC_HEADER = NO;
509503
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
@@ -519,12 +513,14 @@
519513
CLANG_ENABLE_OBJC_ARC = YES;
520514
CODE_SIGN_IDENTITY = "Mac Developer";
521515
COMBINE_HIDPI_IMAGES = YES;
516+
CURRENT_PROJECT_VERSION = 2.1.3;
522517
DEVELOPMENT_TEAM = 857XYUU5FE;
523518
GCC_PRECOMPILE_PREFIX_HEADER = YES;
524519
GCC_PREFIX_HEADER = "DeveloperExcuses/DeveloperExcuses-Prefix.pch";
525520
INFOPLIST_FILE = "DeveloperExcuses/DeveloperExcuses-Info.plist";
526521
INSTALL_PATH = "$(HOME)/Library/Screen Savers";
527522
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
523+
MARKETING_VERSION = 2.1.3;
528524
PRODUCT_BUNDLE_IDENTIFIER = "com.marcuskida.${PRODUCT_NAME:rfc1034identifier}";
529525
PRODUCT_NAME = "$(TARGET_NAME)";
530526
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -541,12 +537,14 @@
541537
CLANG_ENABLE_OBJC_ARC = YES;
542538
CODE_SIGN_IDENTITY = "Mac Developer";
543539
COMBINE_HIDPI_IMAGES = YES;
540+
CURRENT_PROJECT_VERSION = 2.1.3;
544541
DEVELOPMENT_TEAM = 857XYUU5FE;
545542
GCC_PRECOMPILE_PREFIX_HEADER = YES;
546543
GCC_PREFIX_HEADER = "DeveloperExcuses/DeveloperExcuses-Prefix.pch";
547544
INFOPLIST_FILE = "DeveloperExcuses/DeveloperExcuses-Info.plist";
548545
INSTALL_PATH = "$(HOME)/Library/Screen Savers";
549546
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
547+
MARKETING_VERSION = 2.1.3;
550548
PRODUCT_BUNDLE_IDENTIFIER = "com.marcuskida.${PRODUCT_NAME:rfc1034identifier}";
551549
PRODUCT_NAME = "$(TARGET_NAME)";
552550
SWIFT_VERSION = 4.2;

DeveloperExcuses/DeveloperExcuses-Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
<key>CFBundlePackageType</key>
1818
<string>BNDL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>2.1.1</string>
20+
<string>$(MARKETING_VERSION)</string>
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleVersion</key>
24-
<string>2.1.2</string>
24+
<string>$(CURRENT_PROJECT_VERSION)</string>
2525
<key>NSHumanReadableCopyright</key>
2626
<string>Copyright © 2016 Marcus Kida. All rights reserved.</string>
2727
<key>NSPrincipalClass</key>

DeveloperExcuses/Extension/NSTextField+Label.swift

Lines changed: 0 additions & 24 deletions
This file was deleted.

DeveloperExcuses/View/OnelinerView.swift

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@ open class OnelinerView: ScreenSaverView {
2121

2222
convenience init() {
2323
self.init(frame: .zero, isPreview: false)
24-
label = .label(false, bounds: frame)
24+
label = makeLabel(false, bounds: frame)
2525
initialize()
2626
}
2727

2828
override init!(frame: NSRect, isPreview: Bool) {
2929
super.init(frame: frame, isPreview: isPreview)
30-
label = .label(isPreview, bounds: frame)
30+
label = makeLabel(isPreview, bounds: frame)
3131
initialize()
3232
}
3333

3434
required public init?(coder: NSCoder) {
3535
super.init(coder: coder)
36-
label = .label(isPreview, bounds: bounds)
36+
label = makeLabel(isPreview, bounds: bounds)
3737
initialize()
3838
}
3939

@@ -68,6 +68,26 @@ open class OnelinerView: ScreenSaverView {
6868
preconditionFailure("`fetchOneline` must be overridden")
6969
}
7070

71+
private func makeLabel(_ isPreview: Bool, bounds: CGRect) -> NSTextField {
72+
let fontSize: CGFloat = 24.0
73+
let label = NSTextField(frame: bounds)
74+
label.autoresizingMask = NSView.AutoresizingMask.width
75+
label.alignment = .center
76+
label.stringValue = "Loading…"
77+
label.textColor = .white
78+
79+
if #available(OSX 10.15, *) {
80+
label.font = NSFont.monospacedSystemFont(ofSize: fontSize, weight: .medium)
81+
} else {
82+
label.font = NSFont(name: "Courier", size: 24.0)
83+
}
84+
85+
label.backgroundColor = .clear
86+
label.isEditable = false
87+
label.isBezeled = false
88+
return label
89+
}
90+
7191
private func initialize() {
7292
animationTimeInterval = 0.5
7393
addSubview(label)

0 commit comments

Comments
 (0)