From 03167c2382d0064aad01a94ffa07e7282d059e8d Mon Sep 17 00:00:00 2001 From: Naoki Ainoya Date: Mon, 2 Dec 2019 09:54:38 +0900 Subject: [PATCH] disable accessory mode --- README.md | 2 +- siro.xcodeproj/project.pbxproj | 4 +- siro/AppDelegate.swift | 6 ++- siro/Base.lproj/Main.storyboard | 82 +++++++++++++++++++++++++++++++ siro/SettingsViewController.swift | 4 +- 5 files changed, 91 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index b70fb07..ef694d8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Siro +Siro ======= Made posting slack messages easy diff --git a/siro.xcodeproj/project.pbxproj b/siro.xcodeproj/project.pbxproj index 8323825..9e5fd87 100644 --- a/siro.xcodeproj/project.pbxproj +++ b/siro.xcodeproj/project.pbxproj @@ -361,7 +361,7 @@ CODE_SIGN_ENTITLEMENTS = siro/siro.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 5; DEVELOPMENT_TEAM = 9254J5769W; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = siro/Info.plist; @@ -384,7 +384,7 @@ CODE_SIGN_ENTITLEMENTS = siro/siro.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 5; DEVELOPMENT_TEAM = 9254J5769W; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = siro/Info.plist; diff --git a/siro/AppDelegate.swift b/siro/AppDelegate.swift index eebec76..2bd7af0 100644 --- a/siro/AppDelegate.swift +++ b/siro/AppDelegate.swift @@ -35,10 +35,12 @@ class AppDelegate: NSObject, NSApplicationDelegate { } } - private func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) { - let _ = showSiroSettings(_:) + func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool { + let _ = showSiroSettings(sender) + return true } + func applicationWillTerminate(_ aNotification: Notification) { // Insert code here to tear down your application } diff --git a/siro/Base.lproj/Main.storyboard b/siro/Base.lproj/Main.storyboard index bf90a57..18663f3 100644 --- a/siro/Base.lproj/Main.storyboard +++ b/siro/Base.lproj/Main.storyboard @@ -668,6 +668,7 @@ + @@ -970,5 +971,86 @@ DQ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Usage:

1. ctrl+shift+M: open a text window +2. write something as you like +3. command+enter: send the text to slack +4. Esc: close text window + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/siro/SettingsViewController.swift b/siro/SettingsViewController.swift index e3ec376..6a86ae1 100644 --- a/siro/SettingsViewController.swift +++ b/siro/SettingsViewController.swift @@ -38,11 +38,11 @@ class SettingsViewController: NSViewController, NSWindowDelegate { override func viewDidAppear() { self.view.window?.delegate = self - NSApp.setActivationPolicy(.regular) +// NSApp.setActivationPolicy(.regular) } func windowShouldClose(_ sender: NSWindow) -> Bool { - NSApp.setActivationPolicy(.accessory) +// NSApp.setActivationPolicy(.accessory) return true }