dsh-gufa-code 1.2.3 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -21,8 +21,6 @@ static const EventHotKeyID GufaToggleHotKey = {'gufa', 1};
|
|
|
21
21
|
static OSStatus GufaHotKeyHandler(EventHandlerCallRef nextHandler, EventRef event, void *userData);
|
|
22
22
|
|
|
23
23
|
@interface GufaDragStrip : NSView
|
|
24
|
-
@property (nonatomic, weak) id doubleClickTarget;
|
|
25
|
-
@property (nonatomic, assign) SEL doubleClickAction;
|
|
26
24
|
@end
|
|
27
25
|
|
|
28
26
|
@implementation GufaDragStrip
|
|
@@ -36,7 +34,7 @@ static OSStatus GufaHotKeyHandler(EventHandlerCallRef nextHandler, EventRef even
|
|
|
36
34
|
NSFontAttributeName: [NSFont systemFontOfSize:10 weight:NSFontWeightMedium],
|
|
37
35
|
NSForegroundColorAttributeName: [NSColor colorWithCalibratedWhite:1.0 alpha:0.6],
|
|
38
36
|
};
|
|
39
|
-
NSString *label = @"古法编程 · 悬浮层(拖动移动 ·
|
|
37
|
+
NSString *label = @"古法编程 · 悬浮层(拖动移动 · 右键菜单 · ⌥⌘G 切穿透)";
|
|
40
38
|
NSSize size = [label sizeWithAttributes:attrs];
|
|
41
39
|
NSPoint origin = NSMakePoint(floor((self.bounds.size.width - size.width) / 2.0), floor((self.bounds.size.height - size.height) / 2.0));
|
|
42
40
|
[label drawAtPoint:origin withAttributes:attrs];
|
|
@@ -56,10 +54,6 @@ static OSStatus GufaHotKeyHandler(EventHandlerCallRef nextHandler, EventRef even
|
|
|
56
54
|
}
|
|
57
55
|
|
|
58
56
|
- (void)mouseDown:(NSEvent *)event {
|
|
59
|
-
if (event.clickCount == 2 && self.doubleClickTarget != nil && self.doubleClickAction != NULL) {
|
|
60
|
-
[NSApp sendAction:self.doubleClickAction to:self.doubleClickTarget from:self];
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
57
|
[self.window performWindowDragWithEvent:event];
|
|
64
58
|
}
|
|
65
59
|
|
|
@@ -187,8 +181,6 @@ static OSStatus GufaHotKeyHandler(EventHandlerCallRef nextHandler, EventRef even
|
|
|
187
181
|
GufaDragStrip *strip = [[GufaDragStrip alloc] initWithFrame:NSMakeRect(0, frame.size.height - stripHeight, frame.size.width, stripHeight)];
|
|
188
182
|
strip.autoresizingMask = NSViewWidthSizable | NSViewMinYMargin;
|
|
189
183
|
strip.menu = self.mainMenu;
|
|
190
|
-
strip.doubleClickTarget = self;
|
|
191
|
-
strip.doubleClickAction = @selector(toggleClickThrough:);
|
|
192
184
|
[container addSubview:strip];
|
|
193
185
|
self.dragStrip = strip;
|
|
194
186
|
|
|
Binary file
|
package/package.json
CHANGED