diff --git a/app.go b/app.go index 3674c46bc..759ebfc03 100644 --- a/app.go +++ b/app.go @@ -20,7 +20,7 @@ var BuildMode = cmd.BuildModeProd // App defines the main application struct type App struct { - config *Config // The Application configuration object + config *AppConfig // The Application configuration object cli *cmd.Cli // In debug mode, we have a cli renderer interfaces.Renderer // The renderer is what we will render the app to logLevel string // The log level of the app @@ -33,8 +33,8 @@ type App struct { // CreateApp creates the application window with the given configuration // If none given, the defaults are used -func CreateApp(optionalConfig ...*Config) *App { - var userConfig *Config +func CreateApp(optionalConfig ...*AppConfig) *App { + var userConfig *AppConfig if len(optionalConfig) > 0 { userConfig = optionalConfig[0] } diff --git a/cmd/version.go b/cmd/version.go index e3c4e09e9..306020818 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -1,4 +1,4 @@ package cmd // Version - Wails version -const Version = "v0.17.3-pre" +const Version = "v0.17.4-pre" diff --git a/config.go b/config.go index 12f83c7db..076cf1693 100644 --- a/config.go +++ b/config.go @@ -1,14 +1,8 @@ package wails -import ( - "strings" - "github.com/dchest/htmlmin" - // "github.com/leaanthony/mewn" -) - -// Config is the configuration structure used when creating a Wails App object -type Config struct { +// AppConfig is the configuration structure used when creating a Wails App object +type AppConfig struct { Width, Height int Title string defaultHTML string @@ -18,87 +12,60 @@ type Config struct { Colour string Resizable bool DisableInspector bool - // isHTMLFragment bool } // GetWidth returns the desired width -func (a *Config) GetWidth() int { +func (a *AppConfig) GetWidth() int { return a.Width } // GetHeight returns the desired height -func (a *Config) GetHeight() int { +func (a *AppConfig) GetHeight() int { return a.Height } // GetTitle returns the desired window title -func (a *Config) GetTitle() string { +func (a *AppConfig) GetTitle() string { return a.Title } // GetDefaultHTML returns the desired window title -func (a *Config) GetDefaultHTML() string { +func (a *AppConfig) GetDefaultHTML() string { return a.defaultHTML } // GetResizable returns true if the window should be resizable -func (a *Config) GetResizable() bool { +func (a *AppConfig) GetResizable() bool { return a.Resizable } // GetDisableInspector returns true if the inspector should be disabled -func (a *Config) GetDisableInspector() bool { +func (a *AppConfig) GetDisableInspector() bool { return a.DisableInspector } // GetColour returns the colour -func (a *Config) GetColour() string { +func (a *AppConfig) GetColour() string { return a.Colour } // GetCSS returns the user CSS -func (a *Config) GetCSS() string { +func (a *AppConfig) GetCSS() string { return a.CSS } // GetJS returns the user Javascript -func (a *Config) GetJS() string { +func (a *AppConfig) GetJS() string { return a.JS } -func (a *Config) merge(in *Config) error { +func (a *AppConfig) merge(in *AppConfig) error { if in.CSS != "" { a.CSS = in.CSS } if in.Title != "" { a.Title = in.Title } - // if in.HTML != "" { - // minified, err := htmlmin.Minify([]byte(in.HTML), &htmlmin.Options{ - // MinifyScripts: true, - // }) - // if err != nil { - // return err - // } - // inlineHTML := string(minified) - // inlineHTML = strings.Replace(inlineHTML, "'", "\\'", -1) - // inlineHTML = strings.Replace(inlineHTML, "\n", " ", -1) - // a.HTML = strings.TrimSpace(inlineHTML) - - // // Deduce whether this is a full html page or a fragment - // // The document is determined to be a fragment if an HTML - // // tag exists and is located before the first div tag - // HTMLTagIndex := strings.Index(a.HTML, "