Browse Source

v1.3 - added changelog text

master
Claire 2 years ago
parent
commit
33d8a234d7
  1. 17
      LunaMac/Changelog.xib
  2. 17
      LunaMac/ViewController.swift
  3. 3
      LunaMac/changelog.txt

17
LunaMac/Changelog.xib

@ -17,29 +17,32 @@
<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">
<scrollView fixedFrame="YES" borderType="none" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JqF-9e-4Vx">
<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">
<clipView key="contentView" ambiguous="YES" copiesOnScroll="NO" id="rdf-CH-Cev">
<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">
<textView ambiguous="YES" editable="NO" importsGraphics="NO" richText="NO" verticallyResizable="YES" smartInsertDelete="YES" id="wMW-Eo-cAX">
<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"/>
<size key="maxSize" width="440" height="10000000"/>
<color key="insertionPointColor" name="textColor" catalog="System" colorSpace="catalog"/>
<connections>
<outlet property="delegate" destination="JqF-9e-4Vx" id="csZ-k4-WTk"/>
</connections>
</textView>
</subviews>
</clipView>
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="PCv-dl-5KN">
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="YFl-vS-oEZ">
<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">
<scroller key="verticalScroller" verticalHuggingPriority="750" horizontal="NO" id="3OA-G8-HIQ">
<rect key="frame" x="425" y="0.0" width="15" height="230"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
@ -50,7 +53,7 @@
</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="textView" destination="wMW-Eo-cAX" id="vgK-1M-rNU"/>
<outlet property="view" destination="EiT-Mj-1SZ" id="edO-V9-RBV"/>
</connections>
</viewController>

17
LunaMac/ViewController.swift

@ -11,11 +11,12 @@ import Cocoa
class ViewController: NSViewController, NSWindowDelegate {
let appDelegate = NSApplication.shared.delegate as! AppDelegate
@IBOutlet var textView: NSTextView!
override func viewDidLoad() {
print("view did load")
super.viewDidLoad()
toggleWindow(boolShow: true)
@ -26,17 +27,23 @@ class ViewController: NSViewController, NSWindowDelegate {
// use this to load the changelog, maybe?
if (self.view.window?.title.contains("Changelog") ?? false) {
// get log file path
let logPath = Bundle.main.path(forResource: "changelog.txt", ofType: nil)!
// get contents of log file
let logText = try! String(contentsOfFile: logPath, encoding: String.Encoding.utf8)
print(logText)
// create an object to hold the text and its formatting
let textStorage = NSTextStorage(string: logText)
textStorage.font = NSFont(name: "Monaco", size: 11)
textStorage.foregroundColor = NSColor.textColor
// replace textView's textStorage contents
self.textView?.layoutManager?.replaceTextStorage(textStorage)
}
}
// triggers when window is closed
override func viewWillDisappear() {
print("view will disappear")
toggleWindow(boolShow: false)
}

3
LunaMac/changelog.txt

@ -1,4 +1,7 @@
====== Changelog ======
v1.3
- Fixed window duplication bug
- Changelog text loads properly
v1.2
- Added automatic icon update as phase changes

Loading…
Cancel
Save