Skip to content

Commit

Permalink
1.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Apr 2, 2023
1 parent be6c837 commit 189b45f
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 29 deletions.
7 changes: 4 additions & 3 deletions Color Picker.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,9 @@
E3A3B11125904E7B001B4D0C /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
LastSwiftUpdateCheck = 1420;
LastUpgradeCheck = 1400;
LastUpgradeCheck = 1430;
TargetAttributes = {
E34BFA932988F3AF002AB421 = {
CreatedOnToolsVersion = 14.2;
Expand Down Expand Up @@ -456,7 +457,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 13.1;
MACOSX_DEPLOYMENT_TARGET = 13.3;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -514,7 +515,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 13.1;
MACOSX_DEPLOYMENT_TARGET = 13.3;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = macosx;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1400"
LastUpgradeVersion = "1430"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
8 changes: 1 addition & 7 deletions Color Picker/App.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,7 @@ struct AppMain: App {
}

private func setUpConfig() {
#if !DEBUG
SentrySDK.start {
$0.dsn = "https://[email protected]/6139060"
$0.enableSwizzling = false
$0.enableAppHangTracking = false // https://github.com/getsentry/sentry-cocoa/issues/2643
}
#endif
SSApp.initSentry("https://[email protected]/6139060")
}
}

Expand Down
1 change: 0 additions & 1 deletion Color Picker/AppState.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import SwiftUI
import Sentry

@MainActor
final class AppState: ObservableObject {
Expand Down
4 changes: 2 additions & 2 deletions Color Picker/Events.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ extension AppState {
.sink { [self] in
// We only set the state if it's in Dock mode or menu bar mode showing the icon.
if !$0.newValue || ($0.newValue && !Defaults[.hideMenuBarIcon]) {
self.statusItem.isVisible = $0.newValue
statusItem.isVisible = $0.newValue
}

SSApp.isDockIconVisible = !$0.newValue
NSApp.activate(ignoringOtherApps: true)

if !$0.newValue {
LaunchAtLogin.isEnabled = false
self.colorPanel.makeKeyAndOrderFront(nil)
colorPanel.makeKeyAndOrderFront(nil)
}
}
.store(in: &cancellables)
Expand Down
38 changes: 27 additions & 11 deletions Color Picker/Utilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,22 @@ extension SSApp {
}


extension SSApp {
/**
Initialize Sentry.
*/
static func initSentry(_ dsn: String) {
#if !DEBUG && canImport(Sentry)
SentrySDK.start {
$0.dsn = dsn
$0.enableSwizzling = false
$0.enableAppHangTracking = false // https://github.com/getsentry/sentry-cocoa/issues/2643
}
#endif
}
}


enum Device {
static let osVersion: String = {
let os = ProcessInfo.processInfo.operatingSystemVersion
Expand Down Expand Up @@ -409,9 +425,9 @@ final class LocalEventMonitor: ObservableObject {
return event
}

self.objectWillChange.send(event)
objectWillChange.send(event)

if let callback = self.callback {
if let callback {
return callback(event)
}

Expand Down Expand Up @@ -1042,7 +1058,7 @@ struct NativeTextField: NSViewRepresentable {
return
}

self.unfocus()
unfocus()
}.start()

// Cannot be `.leftMouseUp` as the color wheel swallows it.
Expand All @@ -1059,14 +1075,14 @@ struct NativeTextField: NSViewRepresentable {
return event
}

let clickPoint = self.convert(event.locationInWindow, from: nil)
let clickPoint = convert(event.locationInWindow, from: nil)
let clickMargin = 3.0

if !self.frame.insetBy(dx: -clickMargin, dy: -clickMargin).contains(clickPoint) {
self.unfocus()
if !frame.insetBy(dx: -clickMargin, dy: -clickMargin).contains(clickPoint) {
unfocus()
return nil
} else {
self.parent.isFocused = true
parent.isFocused = true
}

return event
Expand Down Expand Up @@ -1321,7 +1337,7 @@ extension ControlActionClosureProtocol {

let trampoline = ActionTrampoline(action: newValue)
target = trampoline
self.action = #selector(ActionTrampoline.handleAction)
action = #selector(ActionTrampoline.handleAction)
objc_setAssociatedObject(self, &controlActionClosureProtocolAssociatedObjectKey, trampoline, .OBJC_ASSOCIATION_RETAIN)
}
}
Expand Down Expand Up @@ -1773,9 +1789,9 @@ extension NSPasteboard {
}

if isActive {
self.start()
start()
} else {
self.stop()
stop()
}
}
.store(in: &cancellables)
Expand Down Expand Up @@ -2367,7 +2383,7 @@ extension Binding where Value: SetAlgebra, Value.Element: Hashable {
}
```
*/
func contains<T>(_ element: T) -> Binding<Bool> where T == Value.Element {
func contains(_ element: Value.Element) -> Binding<Bool> {
.init(
get: { wrappedValue.contains(element) },
set: {
Expand Down
4 changes: 2 additions & 2 deletions Config.xcconfig
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
MARKETING_VERSION = 1.12.1
CURRENT_PROJECT_VERSION = 34
MARKETING_VERSION = 1.13.0
CURRENT_PROJECT_VERSION = 36
11 changes: 9 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,18 @@ The macOS color picker as an app with lots of extra features.

[![](https://tools.applemediaservices.com/api/badges/download-on-the-mac-app-store/black/en-us?size=250x83&releaseDate=1615852800)](https://apps.apple.com/app/id1545870783)

Requires macOS 12 or later.
Requires macOS 13 or later.

**Older versions**

- [Last macOS 11 compatible version](https://github.com/sindresorhus/System-Color-Picker/releases/download/v1.9.6/Color.Picker.1.9.6.-.macOS.11.zip) *(1.9.6)*
- [1.12.1](https://github.com/sindresorhus/System-Color-Picker/releases/download/v1.12.1/Color.Picker.1.12.1.-.macOS.12.zip) for macOS 12+
- [1.9.6](https://github.com/sindresorhus/System-Color-Picker/releases/download/v1.9.6/Color.Picker.1.9.6.-.macOS.11.zip) for macOS 11+

**Non-App Store version**

A special version for users that cannot access the App Store. It won't receive updates.

[Download](https://dsc.cloud/sindresorhus/Color-Picker-1.13.0-1679983870.zip) *(1.13.0 · macOS 13+)*

## Features

Expand Down

0 comments on commit 189b45f

Please sign in to comment.