File tree Expand file tree Collapse file tree 3 files changed +17
-8
lines changed
macOS Calculator/macOS Calculator Expand file tree Collapse file tree 3 files changed +17
-8
lines changed Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" encoding =" UTF-8" ?>
2
- <document type =" com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version =" 3.0" toolsVersion =" 14460.31 " targetRuntime =" MacOSX.Cocoa" propertyAccessControl =" none" useAutolayout =" YES" initialViewController =" B8D-0N-5wS" >
2
+ <document type =" com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version =" 3.0" toolsVersion =" 14490.70 " targetRuntime =" MacOSX.Cocoa" propertyAccessControl =" none" useAutolayout =" YES" initialViewController =" B8D-0N-5wS" >
3
3
<dependencies >
4
4
<deployment identifier =" macosx" />
5
- <plugIn identifier =" com.apple.InterfaceBuilder.CocoaPlugin" version =" 14460.31 " />
5
+ <plugIn identifier =" com.apple.InterfaceBuilder.CocoaPlugin" version =" 14490.70 " />
6
6
<capability name =" documents saved in the Xcode 8 format" minToolsVersion =" 8.0" />
7
7
</dependencies >
8
8
<scenes >
205
205
<menuItem title =" Show Sidebar" keyEquivalent =" s" id =" kIP-vf-haE" >
206
206
<modifierMask key =" keyEquivalentModifierMask" control =" YES" command =" YES" />
207
207
<connections >
208
- <action selector =" toggleSourceList :" target =" Ady-hI-5gd" id =" iwa-gc-5KM" />
208
+ <action selector =" toggleSidebar :" target =" Ady-hI-5gd" id =" iwa-gc-5KM" />
209
209
</connections >
210
210
</menuItem >
211
211
<menuItem title =" Enter Full Screen" keyEquivalent =" f" id =" 4J7-dP-txa" >
607
607
</textView >
608
608
</subviews >
609
609
</clipView >
610
- <scroller key =" verticalScroller" verticalHuggingPriority =" 750" horizontal =" NO" id =" uDS-93-Jy8" >
610
+ <scroller key =" horizontalScroller" hidden =" YES" wantsLayer =" YES" verticalHuggingPriority =" 750" horizontal =" YES" id =" GP5-AW-ICx" >
611
+ <rect key =" frame" x =" -100" y =" -100" width =" 480" height =" 16" />
612
+ <autoresizingMask key =" autoresizingMask" />
613
+ </scroller >
614
+ <scroller key =" verticalScroller" wantsLayer =" YES" verticalHuggingPriority =" 750" horizontal =" NO" id =" uDS-93-Jy8" >
611
615
<rect key =" frame" x =" 464" y =" 0.0" width =" 16" height =" 270" />
612
616
<autoresizingMask key =" autoresizingMask" />
613
617
</scroller >
Original file line number Diff line number Diff line change 17
17
<key >CFBundlePackageType </key >
18
18
<string >APPL </string >
19
19
<key >CFBundleShortVersionString </key >
20
- <string >1.0 </string >
20
+ <string >1.2 </string >
21
21
<key >CFBundleVersion </key >
22
- <string >1 </string >
22
+ <string >001 </string >
23
23
<key >LSMinimumSystemVersion </key >
24
24
<string >$(MACOSX_DEPLOYMENT_TARGET) </string >
25
25
<key >NSHumanReadableCopyright </key >
Original file line number Diff line number Diff line change @@ -13,13 +13,19 @@ class ViewController: NSViewController {
13
13
var calcEngine = getCalcEngine ( )
14
14
var answer = " "
15
15
var operation : operatorCases = . add
16
+ var inDarkMode : Bool {
17
+ let mode = UserDefaults . standard. string ( forKey: " AppleInterfaceStyle " )
18
+ return mode == " Dark "
19
+ }
16
20
17
21
@IBOutlet var display_Panel : NSTextField !
18
22
19
23
override func viewDidLoad( ) {
20
24
super. viewDidLoad ( )
21
25
view. wantsLayer = true
22
- view. layer? . backgroundColor = NSColor . white. cgColor
26
+ if !inDarkMode {
27
+ view. layer? . backgroundColor = NSColor . white. cgColor
28
+ }
23
29
}
24
30
25
31
override var representedObject : Any ? {
@@ -40,7 +46,6 @@ var operation:operatorCases = .add
40
46
41
47
@IBAction func fc( _ sender: NSButton ) {
42
48
display_Panel. stringValue = calcEngine. fc ( original: Double ( display_Panel. stringValue) !)
43
- answer = display_Panel. stringValue
44
49
}
45
50
46
51
@IBAction func cf( _ sender: NSButton ) {
You can’t perform that action at this time.
0 commit comments