add pressure control flag on size and flow, change data directory in OSX to Documents

This commit is contained in:
2017-09-24 18:55:15 +01:00
parent 78484c53a4
commit 04841a996b
14 changed files with 80 additions and 46 deletions

View File

@@ -288,25 +288,13 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime
@interface Window : NSWindow
@end @implementation Window
- (void)keyDown:(NSEvent *)theEvent
{
[[self windowController] keyDown:theEvent];
}
@end
@interface Controller : NSWindowController<NSWindowDelegate>
@end @implementation Controller
- (void)keyDown:(NSEvent *)theEvent
- (void)windowWillClose:(NSNotification *)notification
{
unichar c = [[theEvent charactersIgnoringModifiers] characterAtIndex:0];
if (c == 27)
{
[[NSApplication sharedApplication] terminate:nil];
}
}
- (void)windowDidResize:(NSNotification *)notification
{
[[NSApplication sharedApplication] terminate:nil];
}
@end
@@ -336,9 +324,11 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime
NSRect r = NSMakeRect(0, 0, App::I.width, App::I.height);
view = [[View alloc] initWithFrame:r];
auto style = NSTitledWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask;
controller = [[Controller alloc] initWithWindow:window];
auto style = NSTitledWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask|NSClosableWindowMask;
window = [[Window alloc] initWithContentRect:r styleMask:style backing:NSBackingStoreBuffered defer:NO];
[window setDelegate:controller];
[window setTitle:@"PanoPainter 0.1.2 alpha"];
[window center];
[window makeKeyAndOrderFront:controller];
@@ -346,8 +336,6 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime
[window setAcceptsMouseMovedEvents:true];
[window makeFirstResponder:view];
controller = [[Controller alloc] initWithWindow:window];
auto menubar = [NSMenu new];
auto appMenuItem = [NSMenuItem new];
[menubar addItem:appMenuItem];