5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-04 06:09:56 +08:00

[mac] Small tweaks

This commit is contained in:
Lea Anthony 2021-11-02 20:06:59 +11:00
parent 71f2436562
commit 43cc55cb0a
No known key found for this signature in database
GPG Key ID: 33DAF7BB90A58405
3 changed files with 12 additions and 10 deletions

View File

@ -9,11 +9,12 @@
#define AppDelegate_h #define AppDelegate_h
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
#import "WailsContext.h"
@interface AppDelegate : NSResponder <NSTouchBarProvider> @interface AppDelegate : NSResponder <NSTouchBarProvider>
@property bool alwaysOnTop; @property bool alwaysOnTop;
@property (retain) NSWindow* mainWindow; @property (retain) WailsWindow* mainWindow;
@end @end

View File

@ -9,10 +9,11 @@
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
#import "WindowDelegate.h" #import "WindowDelegate.h"
#import "message.h" #import "message.h"
#import "WailsContext.h"
@implementation WindowDelegate @implementation WindowDelegate
- (BOOL)windowShouldClose:(NSWindow *)sender { - (BOOL)windowShouldClose:(WailsWindow *)sender {
[sender orderOut:nil]; [sender orderOut:nil];
if( self.hideOnClose == false ) { if( self.hideOnClose == false ) {
processMessage("Q"); processMessage("Q");

View File

@ -32,7 +32,7 @@ void processCallback(int callbackID) {
void processURLRequest(void *ctx, const char* url) { void processURLRequest(void *ctx, const char* url) {
NSLog(@"processURLRequest called"); NSLog(@"processURLRequest called");
const char myByteArray[] = { 0x3c,0x68,0x31,0x3e,0x48,0x65,0x6c,0x6c,0x6f,0x20,0x57,0x6f,0x72,0x6c,0x64,0x21,0x3c,0x2f,0x68,0x31,0x3e }; const char myByteArray[] = { 0x3c,0x68,0x31,0x3e,0x48,0x65,0x6c,0x6c,0x6f,0x20,0x57,0x6f,0x72,0x6c,0x64,0x21,0x3c,0x2f,0x68,0x31,0x3e };
ProcessURLResponse(ctx, url, "text/html", myByteArray, 21); ProcessURLResponse(ctx, url, "text/html", (void*)myByteArray, 21);
} }
unsigned char _Users_username_Pictures_SaltBae_png[] = { unsigned char _Users_username_Pictures_SaltBae_png[] = {
@ -200,17 +200,17 @@ unsigned int _Users_username_Pictures_SaltBae_png_len = 1863;
int main(int argc, const char * argv[]) { int main(int argc, const char * argv[]) {
// insert code here... // insert code here...
int frameless = 0; int frameless = 1;
int resizable = 1; int resizable = 0;
int fullscreen = 0; int fullscreen = 0;
int fullSizeContent = 1; int fullSizeContent = 1;
int hideTitleBar = 0; int hideTitleBar = 0;
int titlebarAppearsTransparent = 1; int titlebarAppearsTransparent = 0;
int hideTitle = 0; int hideTitle = 0;
int useToolbar = 1; int useToolbar = 0;
int hideToolbarSeparator = 1; int hideToolbarSeparator = 0;
int webviewIsTransparent = 0; int webviewIsTransparent = 1;
int alwaysOnTop = 1; int alwaysOnTop = 0;
int hideWindowOnClose = 0; int hideWindowOnClose = 0;
const char* appearance = "NSAppearanceNameDarkAqua"; const char* appearance = "NSAppearanceNameDarkAqua";
int windowIsTranslucent = 1; int windowIsTranslucent = 1;