Skip to content

Commit

Permalink
Merge pull request #41 from dado3212/DarkMode
Browse files Browse the repository at this point in the history
Fix dark mode 1.7.1
  • Loading branch information
dado3212 authored Aug 6, 2019
2 parents 42af49b + f48bc48 commit d11a041
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 12 deletions.
1 change: 1 addition & 0 deletions SpacesRenamer/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {

nameChangeWindow.makeKeyAndOrderFront(nil)
nameChangeWindow.selectCurrent()
nameChangeWindow.backgroundColor = .windowBackgroundColor
NSApp.activate(ignoringOtherApps: true)
}
}
Expand Down
8 changes: 4 additions & 4 deletions SpacesRenamer/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13771"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14490.70"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand Down Expand Up @@ -620,7 +620,7 @@
<menuItem title="Show Sidebar" keyEquivalent="s" id="kIP-vf-haE">
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
<connections>
<action selector="toggleSourceList:" target="Ady-hI-5gd" id="iwa-gc-5KM"/>
<action selector="toggleSidebar:" target="Ady-hI-5gd" id="iwa-gc-5KM"/>
</connections>
</menuItem>
<menuItem title="Enter Full Screen" keyEquivalent="f" id="4J7-dP-txa">
Expand Down Expand Up @@ -693,7 +693,7 @@
<rect key="frame" x="39" y="10" width="254" height="42"/>
<subviews>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="s0d-4E-whr">
<rect key="frame" x="10" y="8" width="150" height="25"/>
<rect key="frame" x="9.5" y="9" width="151" height="23"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="150" id="Ngv-75-PXU"/>
</constraints>
Expand Down
9 changes: 4 additions & 5 deletions SpacesRenamer/DesktopSnippet.xib
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="13771" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13771"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14490.70"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
Expand Down Expand Up @@ -37,7 +36,7 @@
</constraints>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="WAL-RR-xNz">
<font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
Expand Down Expand Up @@ -65,6 +64,6 @@
</customView>
</objects>
<resources>
<image name="Monitor" width="318" height="208"/>
<image name="Monitor" width="159" height="104"/>
</resources>
</document>
2 changes: 1 addition & 1 deletion SpacesRenamer/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.7.0</string>
<string>1.7.1</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSMinimumSystemVersion</key>
Expand Down
1 change: 0 additions & 1 deletion SpacesRenamer/NameChangeWindow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class NameChangeWindow: NSWindow {
self.title = "Spaces Renamer"
self.isOpaque = false
self.isMovable = false
self.backgroundColor = NSColor(calibratedHue: 0, saturation: 0.0, brightness: 100, alpha: 0.95)
// To make it auto-hide on F3
self.collectionBehavior = [.transient, .ignoresCycle, .canJoinAllSpaces]
self.level = .modalPanel
Expand Down
7 changes: 7 additions & 0 deletions SpacesRenamer/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import Cocoa
class ViewController: NSViewController {
@IBOutlet var updateButton: NSButton!

private var appearanceChangeObservation: NSKeyValueObservation?

var desktops: [String: NSTextField] = [String: NSTextField]()
var constraints: [NSLayoutConstraint] = []
var viewsToRemove: [NSView] = []
Expand All @@ -22,6 +24,10 @@ class ViewController: NSViewController {
override func viewDidLoad() {
super.viewDidLoad()

appearanceChangeObservation = view.observe(\.effectiveAppearance) { [weak self] _, _ in
self?.refreshViews()
}

setupViews()
}

Expand Down Expand Up @@ -140,6 +146,7 @@ class ViewController: NSViewController {
}

snippet.label.stringValue = "\(i)"
snippet.label.textColor = .highlightColor
snippet.textField.delegate = self
if (monitorPairings[monitorPairings.count - 1][monitorScrollView]!.count > 0) {
monitorPairings[monitorPairings.count - 1][monitorScrollView]!.last?.textField.nextKeyView = snippet.textField
Expand Down
Binary file modified build/spaces-renamer.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion spaces-renamer/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.7.0</string>
<string>1.7.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down

0 comments on commit d11a041

Please sign in to comment.