Skip to content

Commit a949b96

Browse files
committed
fix bug
1 parent a204d81 commit a949b96

File tree

6 files changed

+18
-27
lines changed

6 files changed

+18
-27
lines changed

WindowSnap.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,7 @@
417417
CODE_SIGN_ENTITLEMENTS = WindowSnap/WindowSnap.entitlements;
418418
CODE_SIGN_STYLE = Automatic;
419419
COMBINE_HIDPI_IMAGES = YES;
420+
CURRENT_PROJECT_VERSION = 2;
420421
DEVELOPMENT_TEAM = A2APD4VYNX;
421422
ENABLE_HARDENED_RUNTIME = YES;
422423
INFOPLIST_FILE = WindowSnap/Info.plist;
@@ -425,6 +426,7 @@
425426
"@executable_path/../Frameworks",
426427
);
427428
MACOSX_DEPLOYMENT_TARGET = 10.14;
429+
MARKETING_VERSION = 1.0.1;
428430
PRODUCT_BUNDLE_IDENTIFIER = DevilFingerTeam.WindowSnap;
429431
PRODUCT_NAME = "$(TARGET_NAME)";
430432
SWIFT_OBJC_BRIDGING_HEADER = "WindowSnap/WindowSnap-Bridging-Header.h";
@@ -443,6 +445,7 @@
443445
CODE_SIGN_ENTITLEMENTS = WindowSnap/WindowSnap.entitlements;
444446
CODE_SIGN_STYLE = Automatic;
445447
COMBINE_HIDPI_IMAGES = YES;
448+
CURRENT_PROJECT_VERSION = 2;
446449
DEVELOPMENT_TEAM = A2APD4VYNX;
447450
ENABLE_HARDENED_RUNTIME = YES;
448451
INFOPLIST_FILE = WindowSnap/Info.plist;
@@ -451,6 +454,7 @@
451454
"@executable_path/../Frameworks",
452455
);
453456
MACOSX_DEPLOYMENT_TARGET = 10.14;
457+
MARKETING_VERSION = 1.0.1;
454458
PRODUCT_BUNDLE_IDENTIFIER = DevilFingerTeam.WindowSnap;
455459
PRODUCT_NAME = "$(TARGET_NAME)";
456460
SWIFT_OBJC_BRIDGING_HEADER = "WindowSnap/WindowSnap-Bridging-Header.h";

WindowSnap/AppDelegate.swift

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import Cocoa
1010
import AVFoundation
1111
import ApplicationServices.HIServices.Processes
1212
import DFAXUIElement
13+
import MASShortcut
1314

1415
@NSApplicationMain
1516
class AppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate {
@@ -48,30 +49,16 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate {
4849
}
4950

5051
func applicationDidFinishLaunching(_ aNotification: Notification) {
51-
//2.快捷键
5252

53-
//3.一键最小化 -- show desktop
54-
55-
//4.一键自动化分屏 - 1.设置同程序左右分割, 2.设置同程序叠加,3.随机
56-
57-
//1.自定义 - 1.均分【多少行,多少列】 2.不均分。设置一共多少个。设置大小
58-
59-
//设置hotkey界面
60-
// 整理AXUI的类
61-
// 整理按键模拟
62-
// 整理苹果apple script
63-
// 整理自启动
64-
// 整理无window,only in menu的文档
65-
66-
67-
53+
DFShortCutViewController.regiseterAllWithDefault()
54+
DFMouseAreaHelper.helper.setupAll()
55+
DFAreaSizeHelper.helper.setupTopAreaSize()
56+
DFAreaSizeHelper.helper.setupBottomAreaSize()
6857

6958
launchAtLoginMenu.state = DFLaunchAgentHelper.enabled() ? .on : .off
70-
let _ = NSEvent.addGlobalMonitorForEvents(matching: [.leftMouseUp, .leftMouseDown, .leftMouseDragged]) { (event : NSEvent) in
71-
DFShortCutViewController.regiseterAllWithDefault()
72-
DFMouseAreaHelper.helper.setupAll()
73-
DFAreaSizeHelper.helper.setupTopAreaSize()
74-
DFAreaSizeHelper.helper.setupBottomAreaSize()
59+
let _ = NSEvent.addGlobalMonitorForEvents(matching: [.leftMouseUp, .leftMouseDown, .leftMouseDragged]) {
60+
(event : NSEvent) in
61+
7562
DFMouseMonitorManger.shared.moniter(event: event)
7663

7764
}

WindowSnap/Base.lproj/Main.storyboard

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="JXK-8I-3Iq">
109109
<rect key="frame" x="-2" y="84" width="454" height="16"/>
110110
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
111-
<textFieldCell key="cell" lineBreakMode="clipping" alignment="center" title="V1.0(Build:1)" id="Q32-Zj-3mj">
111+
<textFieldCell key="cell" lineBreakMode="clipping" alignment="center" title="V1.0(Build:2)" id="Q32-Zj-3mj">
112112
<font key="font" metaFont="system"/>
113113
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
114114
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@@ -134,7 +134,7 @@
134134
</viewController>
135135
<customObject id="3On-gs-WLo" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
136136
</objects>
137-
<point key="canvasLocation" x="-232" y="25"/>
137+
<point key="canvasLocation" x="-491" y="89"/>
138138
</scene>
139139
<!--Help View Controller-->
140140
<scene sceneID="J6F-Ww-Cjl">

WindowSnap/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
<key>CFBundlePackageType</key>
2424
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
2525
<key>CFBundleShortVersionString</key>
26-
<string>1.0</string>
26+
<string>$(MARKETING_VERSION)</string>
2727
<key>CFBundleVersion</key>
28-
<string>1</string>
28+
<string>$(CURRENT_PROJECT_VERSION)</string>
2929
<key>LSApplicationCategoryType</key>
3030
<string>public.app-category.utilities</string>
3131
<key>LSMinimumSystemVersion</key>

WindowSnap/ViewController/DFAboutViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class DFAboutViewController: NSViewController {
3838
let build = dict["CFBundleVersion"] as? String
3939

4040
if let version = version, let build = build{
41-
versionLbl.stringValue = "V\(version)(Build:1\(build)"
41+
versionLbl.stringValue = "V\(version)(Build:\(build))"
4242
}
4343
}
4444

WindowSnap/ViewController/DFShortCutViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ extension DFShortCutViewController{
401401
private static func _register(shortcut:MASShortcut?, action:@escaping ()->Void) {
402402
if let sc = shortcut{
403403
if let isReg = MASShortcutMonitor.shared()?.isShortcutRegistered(sc){
404-
if isReg{
404+
if !isReg{
405405
MASShortcutMonitor.shared()?.register(sc, withAction: action)
406406
}
407407
}

0 commit comments

Comments
 (0)