Browse Source

fixed broken icon for end-stage new moon

master
Claire 2 years ago
parent
commit
f2e7aed512
  1. 6
      LunaMac/AppDelegate.swift
  2. 30
      LunaMac/Changelog.xib
  3. 10
      LunaMac/ViewController.swift

6
LunaMac/AppDelegate.swift

@ -136,8 +136,12 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}
}
// if key is new2, rename to new
let key2 = key.contains("2") ? "new" : key
// set image filename
let imgName = key + suffix + ".png"
let imgName = key2 + suffix + ".png"
statusBarItem?.button?.image = NSImage(named: imgName)

30
LunaMac/Changelog.xib

@ -16,11 +16,41 @@
<view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ">
<rect key="frame" x="0.0" y="0.0" width="480" height="270"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<scrollView fixedFrame="YES" borderType="none" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" translatesAutoresizingMaskIntoConstraints="NO" id="EO6-0i-A4N">
<rect key="frame" x="20" y="20" width="440" height="230"/>
<autoresizingMask key="autoresizingMask"/>
<clipView key="contentView" ambiguous="YES" drawsBackground="NO" copiesOnScroll="NO" id="erZ-Oy-cYb">
<rect key="frame" x="0.0" y="0.0" width="425" height="230"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textView ambiguous="YES" importsGraphics="NO" richText="NO" verticallyResizable="YES" smartInsertDelete="YES" id="kdX-vZ-uYh">
<rect key="frame" x="0.0" y="0.0" width="425" height="230"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
<size key="minSize" width="425" height="230"/>
<size key="maxSize" width="437" height="10000000"/>
<color key="insertionPointColor" name="textColor" catalog="System" colorSpace="catalog"/>
</textView>
</subviews>
</clipView>
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="PCv-dl-5KN">
<rect key="frame" x="-100" y="-100" width="225" height="15"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" verticalHuggingPriority="750" horizontal="NO" id="Z6M-bT-XeW">
<rect key="frame" x="425" y="0.0" width="15" height="230"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
</scrollView>
</subviews>
</view>
<point key="canvasLocation" x="226" y="145"/>
</window>
<viewController id="E4t-Te-Ks6" customClass="ViewController" customModule="LunaMac" customModuleProvider="target">
<connections>
<outlet property="textView" destination="kdX-vZ-uYh" id="vBy-fQ-Myn"/>
<outlet property="view" destination="EiT-Mj-1SZ" id="edO-V9-RBV"/>
</connections>
</viewController>

10
LunaMac/ViewController.swift

@ -12,6 +12,8 @@ class ViewController: NSViewController, NSWindowDelegate {
let appDelegate = NSApplication.shared.delegate as! AppDelegate
@IBOutlet var textView: NSTextView!
override func viewDidLoad() {
print("view did load")
super.viewDidLoad()
@ -21,6 +23,14 @@ class ViewController: NSViewController, NSWindowDelegate {
override func viewDidAppear() {
self.view.window?.delegate = self
// use this to load the changelog, maybe?
if (self.view.window?.title.contains("Changelog") ?? false) {
let logPath = Bundle.main.path(forResource: "changelog.txt", ofType: nil)!
let logText = try! String(contentsOfFile: logPath, encoding: String.Encoding.utf8)
print(logText)
}
}
// triggers when window is closed

Loading…
Cancel
Save