mirror of
https://github.com/taigrr/wails.git
synced 2026-04-03 05:38:56 -07:00
Compare commits
21 Commits
v2-mac-doc
...
930_-_defa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c678ab7d01 | ||
|
|
56ef4ddd47 | ||
|
|
bad9ad3dd7 | ||
|
|
36570645ff | ||
|
|
3711bdc41e | ||
|
|
cbdcd9f63e | ||
|
|
a9268bc56e | ||
|
|
f489347fca | ||
|
|
663925f9e8 | ||
|
|
cc2651c377 | ||
|
|
e651b9c7ff | ||
|
|
bcad236fb6 | ||
|
|
0af8d506c1 | ||
|
|
0b65a0f508 | ||
|
|
b03a758747 | ||
|
|
44597f2fbc | ||
|
|
0844113f3a | ||
|
|
79e99b68d6 | ||
|
|
c64b7bb79c | ||
|
|
e72b438ad2 | ||
|
|
3e4a112a3d |
@@ -97,6 +97,9 @@ This project is supported by these kind people / companies:
|
||||
<a href="https://github.com/codydbentley" style="width:100px">
|
||||
<img src="https://github.com/codydbentley.png?size=100" width="100"/>
|
||||
</a>
|
||||
<a href="https://github.com/CrackDavid" style="width:100px">
|
||||
<img src="https://github.com/CrackDavid.png?size=100" width="100"/>
|
||||
</a>
|
||||
<br/>
|
||||
<br/>
|
||||
<a href="https://github.com/matryer" style="width:100px">
|
||||
|
||||
@@ -100,6 +100,9 @@
|
||||
<a href="https://github.com/codydbentley" style="width:100px">
|
||||
<img src="https://github.com/codydbentley.png?size=100" width="100"/>
|
||||
</a>
|
||||
<a href="https://github.com/CrackDavid" style="width:100px">
|
||||
<img src="https://github.com/CrackDavid.png?size=100" width="100"/>
|
||||
</a>
|
||||
<br/>
|
||||
<br/>
|
||||
<a href="https://github.com/matryer" style="width:100px">
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
html {
|
||||
text-align: center;
|
||||
color: white;
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
background-color: rgba(33, 37, 43, 0.2);
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ func main() {
|
||||
Frameless: false,
|
||||
StartHidden: false,
|
||||
HideWindowOnClose: false,
|
||||
RGBA: &options.RGBA{R: 0, G: 0, B: 0, A: 0},
|
||||
RGBA: &options.RGBA{R: 33, G: 37, B: 43, A: 255},
|
||||
Assets: assets,
|
||||
LogLevel: logger.DEBUG,
|
||||
OnStartup: app.startup,
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"assetdir": "frontend/dist",
|
||||
"frontend:install": "npm install",
|
||||
"frontend:build": "npm run build",
|
||||
"wailsjsdir": "./frontend",
|
||||
"author": {
|
||||
"name": "{{.AuthorName}}",
|
||||
"email": "{{.AuthorEmail}}"
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
html {
|
||||
background-color: rgba(33, 37, 43, 0);
|
||||
background-color: rgba(33, 37, 43, 0.2);
|
||||
text-align: center;
|
||||
color: white;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
color: white;
|
||||
font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
|
||||
"Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
|
||||
sans-serif;
|
||||
|
||||
@@ -36,7 +36,7 @@ func main() {
|
||||
Frameless: false,
|
||||
StartHidden: false,
|
||||
HideWindowOnClose: false,
|
||||
RGBA: &options.RGBA{R: 0, G: 0, B: 0, A: 0},
|
||||
RGBA: &options.RGBA{R: 33, G: 37, B: 43, A: 255},
|
||||
Assets: assets,
|
||||
LogLevel: logger.DEBUG,
|
||||
OnStartup: app.startup,
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"name": "{{.ProjectName}}",
|
||||
"outputfilename": "{{.BinaryName}}",
|
||||
"assetdir": "frontend/src",
|
||||
"wailsjsdir": "./frontend",
|
||||
"author": {
|
||||
"name": "{{.AuthorName}}",
|
||||
"email": "{{.AuthorEmail}}"
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
package internal
|
||||
|
||||
var Version = "v2.0.0-beta.15"
|
||||
var Version = "v2.0.0-beta.20"
|
||||
|
||||
@@ -61,6 +61,9 @@ func generateBindings(bindings *binding.Bindings) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if projectConfig.WailsJSDir == "" {
|
||||
projectConfig.WailsJSDir = filepath.Join(cwd, "frontend")
|
||||
}
|
||||
wrapperDir := filepath.Join(projectConfig.WailsJSDir, "wailsjs", "runtime")
|
||||
_ = os.RemoveAll(wrapperDir)
|
||||
extractor := gosod.New(wrapper.RuntimeWrapper)
|
||||
|
||||
@@ -5,6 +5,7 @@ package appng
|
||||
|
||||
import (
|
||||
"context"
|
||||
"flag"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
@@ -58,10 +59,37 @@ func CreateApp(appoptions *options.App) (*App, error) {
|
||||
myLogger.SetLogLevel(appoptions.LogLevel)
|
||||
|
||||
// Check for CLI Flags
|
||||
var assetdirFlag *string
|
||||
var devServerURLFlag *string
|
||||
var loglevelFlag *string
|
||||
|
||||
assetdir := os.Getenv("assetdir")
|
||||
if assetdir == "" {
|
||||
assetdirFlag = flag.String("assetdir", "", "Directory to serve assets")
|
||||
}
|
||||
devServerURL := os.Getenv("devserverurl")
|
||||
if devServerURL == "" {
|
||||
devServerURLFlag = flag.String("devserverurl", "", "URL of development server")
|
||||
}
|
||||
|
||||
loglevel := os.Getenv("loglevel")
|
||||
if loglevel == "" {
|
||||
loglevelFlag = flag.String("loglevel", "debug", "Loglevel to use - Trace, Debug, Info, Warning, Error")
|
||||
}
|
||||
|
||||
// If we weren't given the assetdir in the environment variables
|
||||
if assetdir == "" {
|
||||
flag.Parse()
|
||||
if assetdirFlag != nil {
|
||||
assetdir = *assetdirFlag
|
||||
}
|
||||
if devServerURLFlag != nil {
|
||||
devServerURL = *devServerURLFlag
|
||||
}
|
||||
if loglevelFlag != nil {
|
||||
loglevel = *loglevelFlag
|
||||
}
|
||||
}
|
||||
|
||||
if devServerURL != "" {
|
||||
ctx = context.WithValue(ctx, "devserverurl", devServerURL)
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
@interface AppDelegate : NSResponder <NSTouchBarProvider>
|
||||
|
||||
@property bool alwaysOnTop;
|
||||
@property bool startHidden;
|
||||
@property (retain) WailsWindow* mainWindow;
|
||||
|
||||
@end
|
||||
|
||||
@@ -16,16 +16,22 @@
|
||||
}
|
||||
- (void)applicationWillFinishLaunching:(NSNotification *)aNotification {
|
||||
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
|
||||
[self.mainWindow makeKeyAndOrderFront:self];
|
||||
if (self.alwaysOnTop) {
|
||||
[self.mainWindow setLevel:NSStatusWindowLevel];
|
||||
}
|
||||
if ( !self.startHidden ) {
|
||||
[self.mainWindow makeKeyAndOrderFront:self];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
|
||||
[NSApp activateIgnoringOtherApps:YES];
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@synthesize touchBar;
|
||||
|
||||
@end
|
||||
|
||||
@@ -12,7 +12,12 @@
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "WailsContext.h"
|
||||
|
||||
WailsContext* Create(const char* title, int width, int height, int frameless, int resizable, int fullscreen, int fullSizeContent, int hideTitleBar, int titlebarAppearsTransparent, int hideTitle, int useToolbar, int hideToolbarSeparator, int webviewIsTransparent, int alwaysOnTop, int hideWindowOnClose, const char *appearance, int windowIsTranslucent, int debug);
|
||||
#define WindowStartsNormal 0
|
||||
#define WindowStartsMaximised 1
|
||||
#define WindowStartsMinimised 2
|
||||
#define WindowStartsFullscreen 3
|
||||
|
||||
WailsContext* Create(const char* title, int width, int height, int frameless, int resizable, int fullscreen, int fullSizeContent, int hideTitleBar, int titlebarAppearsTransparent, int hideTitle, int useToolbar, int hideToolbarSeparator, int webviewIsTransparent, int alwaysOnTop, int hideWindowOnClose, const char *appearance, int windowIsTranslucent, int debug, int windowStartState, int startsHidden);
|
||||
void Run(void*);
|
||||
|
||||
void SetTitle(void* ctx, const char *title);
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#import "WailsMenu.h"
|
||||
#import "WailsMenuItem.h"
|
||||
|
||||
WailsContext* Create(const char* title, int width, int height, int frameless, int resizable, int fullscreen, int fullSizeContent, int hideTitleBar, int titlebarAppearsTransparent, int hideTitle, int useToolbar, int hideToolbarSeparator, int webviewIsTransparent, int alwaysOnTop, int hideWindowOnClose, const char *appearance, int windowIsTranslucent, int debug) {
|
||||
WailsContext* Create(const char* title, int width, int height, int frameless, int resizable, int fullscreen, int fullSizeContent, int hideTitleBar, int titlebarAppearsTransparent, int hideTitle, int useToolbar, int hideToolbarSeparator, int webviewIsTransparent, int alwaysOnTop, int hideWindowOnClose, const char *appearance, int windowIsTranslucent, int debug, int windowStartState, int startsHidden) {
|
||||
|
||||
[NSApplication sharedApplication];
|
||||
|
||||
@@ -20,10 +20,27 @@ WailsContext* Create(const char* title, int width, int height, int frameless, in
|
||||
|
||||
result.debug = debug;
|
||||
|
||||
if ( windowStartState == WindowStartsFullscreen ) {
|
||||
fullscreen = 1;
|
||||
}
|
||||
|
||||
[result CreateWindow:width :height :frameless :resizable :fullscreen :fullSizeContent :hideTitleBar :titlebarAppearsTransparent :hideTitle :useToolbar :hideToolbarSeparator :webviewIsTransparent :hideWindowOnClose :safeInit(appearance) :windowIsTranslucent];
|
||||
[result SetTitle:safeInit(title)];
|
||||
[result Center];
|
||||
|
||||
switch( windowStartState ) {
|
||||
case WindowStartsMaximised:
|
||||
[result.mainWindow zoom:nil];
|
||||
break;
|
||||
case WindowStartsMinimised:
|
||||
//TODO: Can you start a mac app minimised?
|
||||
break;
|
||||
}
|
||||
|
||||
if ( startsHidden == 1 ) {
|
||||
result.startHidden = true;
|
||||
}
|
||||
|
||||
result.alwaysOnTop = alwaysOnTop;
|
||||
result.hideOnClose = hideWindowOnClose;
|
||||
|
||||
@@ -306,6 +323,7 @@ void Run(void *inctx) {
|
||||
ctx.appdelegate = delegate;
|
||||
delegate.mainWindow = ctx.mainWindow;
|
||||
delegate.alwaysOnTop = ctx.alwaysOnTop;
|
||||
delegate.startHidden = ctx.startHidden;
|
||||
|
||||
[ctx loadRequest:@"wails://wails/"];
|
||||
[app setMainMenu:ctx.applicationMenu];
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
@property bool hideOnClose;
|
||||
@property bool shuttingDown;
|
||||
@property bool startHidden;
|
||||
|
||||
@property NSSize maxSize;
|
||||
@property NSSize minSize;
|
||||
|
||||
@@ -533,10 +533,10 @@
|
||||
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:arr options:0 error:nil];
|
||||
NSString *nsjson = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
|
||||
processOpenFileDialogResponse([nsjson UTF8String]);
|
||||
[nsjson release];
|
||||
[arr release];
|
||||
}];
|
||||
|
||||
ON_MAIN_THREAD([dialog runModal];)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -579,11 +579,13 @@
|
||||
// Setup callback handler
|
||||
[dialog beginSheetModalForWindow:self.mainWindow completionHandler:^(NSModalResponse returnCode) {
|
||||
NSURL *url = [dialog URL];
|
||||
processSaveFileDialogResponse([url.path UTF8String]);
|
||||
if ( url != nil ) {
|
||||
processSaveFileDialogResponse([url.path UTF8String]);
|
||||
return;
|
||||
}
|
||||
processSaveFileDialogResponse("");
|
||||
}];
|
||||
|
||||
ON_MAIN_THREAD([dialog runModal];)
|
||||
|
||||
|
||||
}
|
||||
|
||||
- (void) SetAbout :(NSString*)title :(NSString*)description :(void*)imagedata :(int)datalen {
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
}
|
||||
|
||||
- (NSMenuItem*) newMenuItemWithContext :(WailsContext*)ctx :(NSString*)title :(SEL)selector :(NSString*)key :(NSEventModifierFlags)flags {
|
||||
NSMenuItem *result = [[NSMenuItem new] autorelease];
|
||||
NSMenuItem *result = [NSMenuItem new];
|
||||
if ( title != nil ) {
|
||||
[result setTitle:title];
|
||||
}
|
||||
@@ -45,7 +45,7 @@
|
||||
[super initWithTitle:title];
|
||||
}
|
||||
[self setAutoenablesItems:NO];
|
||||
return self;
|
||||
return [self init];
|
||||
}
|
||||
|
||||
- (void) appendSubmenu :(WailsMenu*)child {
|
||||
|
||||
@@ -47,6 +47,7 @@ func NewWindow(frontendOptions *options.App, debugMode bool) *Window {
|
||||
fullscreen := bool2Cint(frontendOptions.Fullscreen)
|
||||
alwaysOnTop := bool2Cint(frontendOptions.AlwaysOnTop)
|
||||
hideWindowOnClose := bool2Cint(frontendOptions.HideWindowOnClose)
|
||||
startsHidden := bool2Cint(frontendOptions.StartHidden)
|
||||
debug := bool2Cint(debugMode)
|
||||
|
||||
var fullSizeContent, hideTitleBar, hideTitle, useToolbar, webviewIsTransparent C.int
|
||||
@@ -55,6 +56,7 @@ func NewWindow(frontendOptions *options.App, debugMode bool) *Window {
|
||||
|
||||
width := C.int(frontendOptions.Width)
|
||||
height := C.int(frontendOptions.Height)
|
||||
windowStartState := C.int(int(frontendOptions.WindowStartState))
|
||||
|
||||
title = c.String(frontendOptions.Title)
|
||||
|
||||
@@ -75,7 +77,7 @@ func NewWindow(frontendOptions *options.App, debugMode bool) *Window {
|
||||
}
|
||||
var context *C.WailsContext = C.Create(title, width, height, frameless, resizable, fullscreen, fullSizeContent,
|
||||
hideTitleBar, titlebarAppearsTransparent, hideTitle, useToolbar, hideToolbarSeparator, webviewIsTransparent,
|
||||
alwaysOnTop, hideWindowOnClose, appearance, windowIsTranslucent, debug)
|
||||
alwaysOnTop, hideWindowOnClose, appearance, windowIsTranslucent, debug, windowStartState, startsHidden)
|
||||
|
||||
// Create menu
|
||||
result := &Window{
|
||||
|
||||
@@ -130,10 +130,6 @@ func (f *Frontend) Run(ctx context.Context) error {
|
||||
}
|
||||
}()
|
||||
|
||||
if f.frontendOptions.Fullscreen {
|
||||
mainWindow.Fullscreen()
|
||||
}
|
||||
|
||||
mainWindow.Run()
|
||||
mainWindow.Close()
|
||||
return nil
|
||||
@@ -412,11 +408,6 @@ func (f *Frontend) navigationCompleted(sender *edge.ICoreWebView2, args *edge.IC
|
||||
go f.frontendOptions.OnDomReady(f.ctx)
|
||||
}
|
||||
|
||||
// If you want to start hidden, return
|
||||
if f.frontendOptions.StartHidden {
|
||||
return
|
||||
}
|
||||
|
||||
// Hack to make it visible: https://github.com/MicrosoftEdge/WebView2Feedback/issues/1077#issuecomment-825375026
|
||||
err := f.chromium.Hide()
|
||||
if err != nil {
|
||||
@@ -426,6 +417,24 @@ func (f *Frontend) navigationCompleted(sender *edge.ICoreWebView2, args *edge.IC
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
f.mainWindow.Show()
|
||||
|
||||
if f.frontendOptions.StartHidden {
|
||||
return
|
||||
}
|
||||
|
||||
switch f.frontendOptions.WindowStartState {
|
||||
case options.Maximised:
|
||||
f.mainWindow.Maximise()
|
||||
case options.Minimised:
|
||||
f.mainWindow.Minimise()
|
||||
case options.Fullscreen:
|
||||
f.mainWindow.Fullscreen()
|
||||
f.mainWindow.Show()
|
||||
default:
|
||||
if f.frontendOptions.Fullscreen {
|
||||
f.mainWindow.Fullscreen()
|
||||
}
|
||||
f.mainWindow.Show()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,24 +18,24 @@ type Window struct {
|
||||
dispatchq []func()
|
||||
}
|
||||
|
||||
func NewWindow(parent winc.Controller, options *options.App) *Window {
|
||||
func NewWindow(parent winc.Controller, appoptions *options.App) *Window {
|
||||
result := new(Window)
|
||||
result.frontendOptions = options
|
||||
result.frontendOptions = appoptions
|
||||
result.SetIsForm(true)
|
||||
|
||||
var exStyle int
|
||||
if options.Windows != nil {
|
||||
if appoptions.Windows != nil {
|
||||
exStyle = w32.WS_EX_CONTROLPARENT | w32.WS_EX_APPWINDOW
|
||||
if options.Windows.WindowIsTranslucent {
|
||||
if appoptions.Windows.WindowIsTranslucent {
|
||||
exStyle |= w32.WS_EX_NOREDIRECTIONBITMAP
|
||||
}
|
||||
}
|
||||
if options.AlwaysOnTop {
|
||||
if appoptions.AlwaysOnTop {
|
||||
exStyle |= w32.WS_EX_TOPMOST
|
||||
}
|
||||
|
||||
var dwStyle = w32.WS_OVERLAPPEDWINDOW
|
||||
if options.Frameless {
|
||||
if appoptions.Frameless {
|
||||
dwStyle = w32.WS_POPUP
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ func NewWindow(parent winc.Controller, options *options.App) *Window {
|
||||
result.SetParent(parent)
|
||||
|
||||
loadIcon := true
|
||||
if options.Windows != nil && options.Windows.DisableWindowIcon == true {
|
||||
if appoptions.Windows != nil && appoptions.Windows.DisableWindowIcon == true {
|
||||
loadIcon = false
|
||||
}
|
||||
if loadIcon {
|
||||
@@ -53,21 +53,21 @@ func NewWindow(parent winc.Controller, options *options.App) *Window {
|
||||
}
|
||||
}
|
||||
|
||||
result.SetSize(options.Width, options.Height)
|
||||
result.SetText(options.Title)
|
||||
if options.Frameless == false && !options.Fullscreen {
|
||||
result.EnableMaxButton(!options.DisableResize)
|
||||
result.EnableSizable(!options.DisableResize)
|
||||
result.SetMinSize(options.MinWidth, options.MinHeight)
|
||||
result.SetMaxSize(options.MaxWidth, options.MaxHeight)
|
||||
result.SetSize(appoptions.Width, appoptions.Height)
|
||||
result.SetText(appoptions.Title)
|
||||
if appoptions.Frameless == false && !appoptions.Fullscreen {
|
||||
result.EnableMaxButton(!appoptions.DisableResize)
|
||||
result.EnableSizable(!appoptions.DisableResize)
|
||||
result.SetMinSize(appoptions.MinWidth, appoptions.MinHeight)
|
||||
result.SetMaxSize(appoptions.MaxWidth, appoptions.MaxHeight)
|
||||
}
|
||||
|
||||
if options.Windows != nil {
|
||||
if options.Windows.WindowIsTranslucent {
|
||||
if appoptions.Windows != nil {
|
||||
if appoptions.Windows.WindowIsTranslucent {
|
||||
result.SetTranslucentBackground()
|
||||
}
|
||||
|
||||
if options.Windows.DisableWindowIcon {
|
||||
if appoptions.Windows.DisableWindowIcon {
|
||||
result.DisableIcon()
|
||||
}
|
||||
}
|
||||
@@ -78,8 +78,8 @@ func NewWindow(parent winc.Controller, options *options.App) *Window {
|
||||
|
||||
result.SetFont(winc.DefaultFont)
|
||||
|
||||
if options.Menu != nil {
|
||||
result.SetApplicationMenu(options.Menu)
|
||||
if appoptions.Menu != nil {
|
||||
result.SetApplicationMenu(appoptions.Menu)
|
||||
}
|
||||
|
||||
return result
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package gomod
|
||||
|
||||
import (
|
||||
"github.com/Masterminds/semver"
|
||||
"github.com/matryer/is"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/Masterminds/semver"
|
||||
"github.com/matryer/is"
|
||||
)
|
||||
|
||||
const basic string = `module changeme
|
||||
@@ -75,7 +76,7 @@ const basicUpdated string = `module changeme
|
||||
|
||||
go 1.17
|
||||
|
||||
require github.com/wailsapp/wails/v2 v2.0.0-beta.15
|
||||
require github.com/wailsapp/wails/v2 v2.0.0-beta.20
|
||||
|
||||
require (
|
||||
github.com/andybalholm/brotli v1.0.2 // indirect
|
||||
@@ -330,7 +331,7 @@ const multilineRequireUpdated = `module changeme
|
||||
go 1.17
|
||||
|
||||
require (
|
||||
github.com/wailsapp/wails/v2 v2.0.0-beta.15
|
||||
github.com/wailsapp/wails/v2 v2.0.0-beta.20
|
||||
)
|
||||
|
||||
require (
|
||||
@@ -381,12 +382,12 @@ func TestUpdateGoModVersion(t *testing.T) {
|
||||
want []byte
|
||||
wantErr bool
|
||||
}{
|
||||
{"basic", args{[]byte(basic), "v2.0.0-beta.15"}, []byte(basicUpdated), false},
|
||||
{"basicmultiline", args{[]byte(multilineRequire), "v2.0.0-beta.15"}, []byte(multilineRequireUpdated), false},
|
||||
{"basicmultilinereplace", args{[]byte(multilineReplace), "v2.0.0-beta.15"}, []byte(multilineReplaceUpdated), false},
|
||||
{"basicmultilinereplaceblock", args{[]byte(multilineReplaceBlock), "v2.0.0-beta.15"}, []byte(multilineReplaceBlockUpdated), false},
|
||||
{"basicmultilinereplacenoversion", args{[]byte(multilineReplaceNoVersion), "v2.0.0-beta.15"}, []byte(multilineReplaceNoVersionUpdated), false},
|
||||
{"basicmultilinereplacenoversionblock", args{[]byte(multilineReplaceNoVersionBlock), "v2.0.0-beta.15"}, []byte(multilineReplaceNoVersionBlockUpdated), false},
|
||||
{"basic", args{[]byte(basic), "v2.0.0-beta.20"}, []byte(basicUpdated), false},
|
||||
{"basicmultiline", args{[]byte(multilineRequire), "v2.0.0-beta.20"}, []byte(multilineRequireUpdated), false},
|
||||
{"basicmultilinereplace", args{[]byte(multilineReplace), "v2.0.0-beta.20"}, []byte(multilineReplaceUpdated), false},
|
||||
{"basicmultilinereplaceblock", args{[]byte(multilineReplaceBlock), "v2.0.0-beta.20"}, []byte(multilineReplaceBlockUpdated), false},
|
||||
{"basicmultilinereplacenoversion", args{[]byte(multilineReplaceNoVersion), "v2.0.0-beta.20"}, []byte(multilineReplaceNoVersionUpdated), false},
|
||||
{"basicmultilinereplacenoversionblock", args{[]byte(multilineReplaceNoVersionBlock), "v2.0.0-beta.20"}, []byte(multilineReplaceNoVersionBlockUpdated), false},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
@@ -413,8 +414,8 @@ func TestGoModOutOfSync(t *testing.T) {
|
||||
want bool
|
||||
wantErr bool
|
||||
}{
|
||||
{"basic", args{[]byte(basic), "v2.0.0-beta.15"}, true, false},
|
||||
{"basicmultiline", args{[]byte(multilineRequire), "v2.0.0-beta.15"}, true, false},
|
||||
{"basic", args{[]byte(basic), "v2.0.0-beta.20"}, true, false},
|
||||
{"basicmultiline", args{[]byte(multilineRequire), "v2.0.0-beta.20"}, true, false},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
@@ -433,7 +434,7 @@ const multilineReplaceUpdated = `module changeme
|
||||
go 1.17
|
||||
|
||||
require (
|
||||
github.com/wailsapp/wails/v2 v2.0.0-beta.15
|
||||
github.com/wailsapp/wails/v2 v2.0.0-beta.20
|
||||
)
|
||||
|
||||
require (
|
||||
@@ -468,14 +469,14 @@ require (
|
||||
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6 // indirect
|
||||
)
|
||||
|
||||
replace github.com/wailsapp/wails/v2 v2.0.0-beta.15 => C:\Users\leaan\Documents\wails-v2-beta\wails\v2
|
||||
replace github.com/wailsapp/wails/v2 v2.0.0-beta.20 => C:\Users\leaan\Documents\wails-v2-beta\wails\v2
|
||||
`
|
||||
const multilineReplaceNoVersionUpdated = `module changeme
|
||||
|
||||
go 1.17
|
||||
|
||||
require (
|
||||
github.com/wailsapp/wails/v2 v2.0.0-beta.15
|
||||
github.com/wailsapp/wails/v2 v2.0.0-beta.20
|
||||
)
|
||||
|
||||
require (
|
||||
@@ -517,7 +518,7 @@ const multilineReplaceNoVersionBlockUpdated = `module changeme
|
||||
go 1.17
|
||||
|
||||
require (
|
||||
github.com/wailsapp/wails/v2 v2.0.0-beta.15
|
||||
github.com/wailsapp/wails/v2 v2.0.0-beta.20
|
||||
)
|
||||
|
||||
require (
|
||||
@@ -562,7 +563,7 @@ const multilineReplaceBlockUpdated = `module changeme
|
||||
go 1.17
|
||||
|
||||
require (
|
||||
github.com/wailsapp/wails/v2 v2.0.0-beta.15
|
||||
github.com/wailsapp/wails/v2 v2.0.0-beta.20
|
||||
)
|
||||
|
||||
require (
|
||||
@@ -598,6 +599,6 @@ require (
|
||||
)
|
||||
|
||||
replace (
|
||||
github.com/wailsapp/wails/v2 v2.0.0-beta.15 => C:\Users\leaan\Documents\wails-v2-beta\wails\v2
|
||||
github.com/wailsapp/wails/v2 v2.0.0-beta.20 => C:\Users\leaan\Documents\wails-v2-beta\wails\v2
|
||||
)
|
||||
`
|
||||
|
||||
@@ -532,6 +532,9 @@ func (b *BaseBuilder) BuildFrontend(outputLogger *clilogger.CLILogger) error {
|
||||
switch b.projectData.OutputType {
|
||||
case "dev":
|
||||
buildCommand = b.projectData.DevCommand
|
||||
if buildCommand == "" {
|
||||
buildCommand = b.projectData.BuildCommand
|
||||
}
|
||||
default:
|
||||
buildCommand = b.projectData.BuildCommand
|
||||
}
|
||||
|
||||
@@ -15,6 +15,15 @@ import (
|
||||
"github.com/wailsapp/wails/v2/pkg/logger"
|
||||
)
|
||||
|
||||
type WindowStartState int
|
||||
|
||||
const (
|
||||
Normal WindowStartState = 0
|
||||
Maximised WindowStartState = 1
|
||||
Minimised WindowStartState = 2
|
||||
Fullscreen WindowStartState = 3
|
||||
)
|
||||
|
||||
// App contains options for creating the App
|
||||
type App struct {
|
||||
Title string
|
||||
@@ -39,6 +48,7 @@ type App struct {
|
||||
OnDomReady func(ctx context.Context) `json:"-"`
|
||||
OnShutdown func(ctx context.Context) `json:"-"`
|
||||
Bind []interface{}
|
||||
WindowStartState WindowStartState
|
||||
|
||||
//ContextMenus []*menu.ContextMenu
|
||||
//TrayMenus []*menu.TrayMenu
|
||||
|
||||
@@ -20,7 +20,7 @@ You mean this isn't ready for production? For your use case, it may well be read
|
||||
known issues so keep your eye on [this project board](https://github.com/wailsapp/wails/projects/7) and if you would
|
||||
like to contribute, you'd be very welcome!
|
||||
|
||||
So what's new for Wails v2 for Mac vs v1? Hint: They're pretty similar to the Windows Beta :wink:
|
||||
So what's new for Wails v2 for Mac vs v1? Hint: It's pretty similar to the Windows Beta :wink:
|
||||
|
||||
### New Features
|
||||
|
||||
@@ -23,6 +23,9 @@ sidebar_position: 99
|
||||
<a href="https://github.com/codydbentley" style="width:100px">
|
||||
<img src="https://github.com/codydbentley.png?size=100" width="100"/>
|
||||
</a>
|
||||
<a href="https://github.com/CrackDavid" style="width:100px">
|
||||
<img src="https://github.com/CrackDavid.png?size=100" width="100"/>
|
||||
</a>
|
||||
<br/>
|
||||
<br/>
|
||||
<a href="https://github.com/matryer" style="width:100px">
|
||||
|
||||
@@ -67,7 +67,7 @@ import TabItem from "@theme/TabItem";
|
||||
|
||||
## Installing Wails
|
||||
|
||||
Run `go install github.com/wailsapp/wails/v2/cmd/wails@v2.0.0-beta.15` to install the Wails CLI.
|
||||
Run `go install github.com/wailsapp/wails/v2/cmd/wails@v2.0.0-beta.20` to install the Wails CLI.
|
||||
|
||||
## System Check
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ import TabItem from "@theme/TabItem";
|
||||
|
||||
## 安装 Wails
|
||||
|
||||
运行 `go install github.com/wailsapp/wails/v2/cmd/wails@v2.0.0-beta.15` 安装 Wails CLI。
|
||||
运行 `go install github.com/wailsapp/wails/v2/cmd/wails@v2.0.0-beta.20` 安装 Wails CLI。
|
||||
|
||||
## 系统检查
|
||||
|
||||
|
||||
Reference in New Issue
Block a user