Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
58 changed files
with
2,755 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Pods | ||
Podfile.lock | ||
OpenFile.xcworkspace/xcuserdata/HouMeng.xcuserdatad/UserInterfaceState.xcuserstate | ||
*.xcuserstate |
Large diffs are not rendered by default.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
OpenFile.xcodeproj/project.xcworkspace/contents.xcworkspacedata
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
OpenFile.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>IDEDidComputeMac32BitWarning</key> | ||
<true/> | ||
</dict> | ||
</plist> |
24 changes: 24 additions & 0 deletions
24
...j/project.xcworkspace/xcuserdata/HouMeng.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Bucket | ||
uuid = "6EAADDEA-4FAD-4347-B5F2-82AE5C062ED5" | ||
type = "0" | ||
version = "2.0"> | ||
<Breakpoints> | ||
<BreakpointProxy | ||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | ||
<BreakpointContent | ||
uuid = "2B90020E-FBA7-44EA-99A5-E36C1A6E3D52" | ||
shouldBeEnabled = "Yes" | ||
ignoreCount = "0" | ||
continueAfterRunningActions = "No" | ||
filePath = "../OpenFile/Popover/HmPopoverController.swift" | ||
startingColumnNumber = "9223372036854775807" | ||
endingColumnNumber = "9223372036854775807" | ||
startingLineNumber = "76" | ||
endingLineNumber = "76" | ||
landmarkName = "collectionView(_:itemForRepresentedObjectAt:)" | ||
landmarkType = "7"> | ||
</BreakpointContent> | ||
</BreakpointProxy> | ||
</Breakpoints> | ||
</Bucket> |
14 changes: 14 additions & 0 deletions
14
OpenFile.xcodeproj/xcuserdata/HouMeng.xcuserdatad/xcschemes/xcschememanagement.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>SchemeUserState</key> | ||
<dict> | ||
<key>OpenFile.xcscheme_^#shared#^_</key> | ||
<dict> | ||
<key>orderHint</key> | ||
<integer>5</integer> | ||
</dict> | ||
</dict> | ||
</dict> | ||
</plist> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>IDEDidComputeMac32BitWarning</key> | ||
<true/> | ||
</dict> | ||
</plist> |
19 changes: 19 additions & 0 deletions
19
OpenFile.xcworkspace/xcuserdata/HouMeng.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Bucket | ||
uuid = "6F75D40C-F9AF-4DB0-9EDD-B979816E181D" | ||
type = "0" | ||
version = "2.0"> | ||
<Breakpoints> | ||
<BreakpointProxy | ||
BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint"> | ||
<BreakpointContent | ||
uuid = "1DEDB4FE-A068-40FC-8047-D01B3D72D324" | ||
shouldBeEnabled = "Yes" | ||
ignoreCount = "0" | ||
continueAfterRunningActions = "No" | ||
scope = "1" | ||
stopOnStyle = "0"> | ||
</BreakpointContent> | ||
</BreakpointProxy> | ||
</Breakpoints> | ||
</Bucket> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// | ||
// AppDelegate.swift | ||
// OpenFile | ||
// | ||
// Created by 侯猛 on 2019/12/23. | ||
// Copyright © 2019 侯猛. All rights reserved. | ||
// | ||
|
||
import Cocoa | ||
|
||
@NSApplicationMain | ||
class AppDelegate: NSObject, NSApplicationDelegate { | ||
|
||
func applicationDidFinishLaunching(_ aNotification: Notification) { | ||
// Insert code here to initialize your application | ||
} | ||
|
||
func applicationWillTerminate(_ aNotification: Notification) { | ||
// Insert code here to tear down your application | ||
} | ||
|
||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"size" : "16x16", | ||
"idiom" : "mac", | ||
"filename" : "mac-16x16.png", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"size" : "16x16", | ||
"idiom" : "mac", | ||
"filename" : "mac-16x16@2x.png", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"size" : "32x32", | ||
"idiom" : "mac", | ||
"filename" : "mac-32x32.png", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"size" : "32x32", | ||
"idiom" : "mac", | ||
"filename" : "mac-32x32@2x.png", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"size" : "128x128", | ||
"idiom" : "mac", | ||
"filename" : "mac-128x128.png", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"size" : "128x128", | ||
"idiom" : "mac", | ||
"filename" : "mac-128x128@2x.png", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"size" : "256x256", | ||
"idiom" : "mac", | ||
"filename" : "mac-256x256.png", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"size" : "256x256", | ||
"idiom" : "mac", | ||
"filename" : "mac-256x256@2x.png", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"size" : "512x512", | ||
"idiom" : "mac", | ||
"filename" : "mac-512x512.png", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"size" : "512x512", | ||
"idiom" : "mac", | ||
"filename" : "mac-512x512@2x.png", | ||
"scale" : "2x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "StatusBar.png", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "StatusBar@2x.png", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "StatusBar@3x.png", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
}, | ||
"properties" : { | ||
"template-rendering-intent" : "template" | ||
} | ||
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
// | ||
// HmButton.swift | ||
// OpenFile | ||
// | ||
// Created by 侯猛 on 2019/12/27. | ||
// Copyright © 2019 侯猛. All rights reserved. | ||
// | ||
|
||
import Cocoa | ||
|
||
enum MouseType { | ||
case leftDown | ||
case leftUp | ||
case rightDown | ||
case rightUp | ||
case entered | ||
case exited | ||
} | ||
|
||
class HmButton: NSButton { | ||
|
||
private var trackingArea: NSTrackingArea? | ||
|
||
var mouseClickTypeHandler: ((MouseType) -> Void)? | ||
|
||
override func updateTrackingAreas() { | ||
super.updateTrackingAreas() | ||
removeTrackingArea() | ||
let options : NSTrackingArea.Options = [.mouseEnteredAndExited, .activeInKeyWindow] | ||
let newBounds = NSRect(x: 5, y: 5, width: bounds.width - 10, height: bounds.height - 10) | ||
trackingArea = NSTrackingArea(rect: newBounds, options: options, owner: self, userInfo: nil) | ||
addTrackingArea(trackingArea!) | ||
|
||
guard var mouseLocation = window?.mouseLocationOutsideOfEventStream else { | ||
return | ||
} | ||
mouseLocation = convert(mouseLocation, from: nil) | ||
if NSPointInRect(mouseLocation, bounds) { | ||
mouseEntered(with: NSEvent()) | ||
} else { | ||
mouseExited(with: NSEvent()) | ||
} | ||
} | ||
|
||
private func removeTrackingArea() { | ||
if trackingArea != nil { | ||
removeTrackingArea(trackingArea!) | ||
} | ||
} | ||
|
||
override func draw(_ dirtyRect: NSRect) { | ||
super.draw(dirtyRect) | ||
|
||
// Drawing code here. | ||
} | ||
|
||
override func mouseDown(with event: NSEvent) { | ||
// super.mouseDown(with: event) | ||
mouseClickTypeHandler?(.leftDown) | ||
} | ||
|
||
override func mouseUp(with event: NSEvent) { | ||
// super.mouseUp(with: event) | ||
mouseClickTypeHandler?(.leftUp) | ||
} | ||
|
||
override func rightMouseDown(with event: NSEvent) { | ||
super.rightMouseDown(with: event) | ||
mouseClickTypeHandler?(.rightDown) | ||
} | ||
|
||
override func rightMouseUp(with event: NSEvent) { | ||
// super.rightMouseUp(with: event) | ||
mouseClickTypeHandler?(.rightUp) | ||
} | ||
|
||
override func mouseEntered(with event: NSEvent) { | ||
// super.mouseEntered(with: event) | ||
mouseClickTypeHandler?(.entered) | ||
} | ||
|
||
override func mouseExited(with event: NSEvent) { | ||
// super.mouseExited(with: event) | ||
mouseClickTypeHandler?(.exited) | ||
} | ||
|
||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// | ||
// HistoryThumbnailLabel.swift | ||
// uPic | ||
// | ||
// Created by 侯猛 on 2019/11/26. | ||
// Copyright © 2019 Svend Jin. All rights reserved. | ||
// | ||
|
||
import Cocoa | ||
|
||
class HmLabel: NSTextField { | ||
|
||
private var oldStringValue: String? | ||
|
||
private var oldTextColor: NSColor? | ||
|
||
override func awakeFromNib() { | ||
super.awakeFromNib() | ||
initializeView() | ||
} | ||
|
||
func initializeView() { | ||
oldStringValue = stringValue | ||
oldTextColor = textColor | ||
cell = VerticalCenteringCell() | ||
backgroundColor = .clear | ||
canDrawSubviewsIntoLayer = true | ||
alignment = .center | ||
isEditable = false | ||
stringValue = oldStringValue ?? "" | ||
textColor = oldTextColor | ||
oldStringValue = nil | ||
oldTextColor = nil | ||
} | ||
|
||
} | ||
|
||
|
||
class VerticalCenteringCell: NSTextFieldCell { | ||
override func titleRect(forBounds rect: NSRect) -> NSRect { | ||
var rect = super.titleRect(forBounds: rect) | ||
rect.origin.y += (rect.height - cellSize.height) / 2 | ||
return rect | ||
} | ||
|
||
override func drawInterior(withFrame cellFrame: NSRect, in controlView: NSView) { | ||
super.drawInterior(withFrame: titleRect(forBounds: cellFrame), in: controlView) | ||
} | ||
|
||
override func select(withFrame rect: NSRect, in controlView: NSView, editor textObj: NSText, delegate: Any?, start selStart: Int, length selLength: Int) { | ||
super.select(withFrame: titleRect(forBounds: rect), in: controlView, editor: textObj, delegate: delegate, start: selStart, length: selLength) | ||
} | ||
|
||
} |
Oops, something went wrong.