5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-03 06:51:26 +08:00

Merge branch 'develop'

This commit is contained in:
Lea Anthony 2020-12-08 20:43:40 +11:00
commit 39d687fa31
5 changed files with 58 additions and 14 deletions

View File

@ -65,6 +65,8 @@ const (
Solus
// Ctlos Linux distribution
Ctlos
// EndeavourOS linux distribution
EndeavourOS
)
// DistroInfo contains all the information relating to a linux distribution
@ -171,6 +173,8 @@ func parseOsRelease(osRelease string) *DistroInfo {
result.Distribution = PopOS
case "solus":
result.Distribution = Solus
case "endeavouros":
result.Distribution = EndeavourOS
default:
result.Distribution = Unknown
}

View File

@ -203,6 +203,15 @@ distributions:
gccversioncommand: *gccdumpversion
programs: *archdefaultprograms
libraries: *archdefaultlibraries
endeavouros:
id: endeavouros
releases:
default:
version: default
name: EndeavourOS
gccversioncommand: *gccdumpversion
programs: *archdefaultprograms
libraries: *archdefaultlibraries
manjaro:
id: manjaro
releases:

View File

@ -276,7 +276,7 @@ func CheckDependencies(logger *Logger) (bool, error) {
switch distroInfo.Distribution {
case Ubuntu, Debian, Zorin, Parrot, Linuxmint, Elementary, Kali, Neon, Deepin, Raspbian, PopOS:
libraryChecker = DpkgInstalled
case Arch, ArcoLinux, ArchLabs, Ctlos, Manjaro, ManjaroARM:
case Arch, ArcoLinux, ArchLabs, Ctlos, Manjaro, ManjaroARM, EndeavourOS:
libraryChecker = PacmanInstalled
case CentOS, Fedora, Tumbleweed, Leap:
libraryChecker = RpmInstalled

View File

@ -1,4 +1,4 @@
package cmd
// Version - Wails version
const Version = "v1.9.1"
const Version = "v1.10.0"

View File

@ -1,20 +1,38 @@
package wails
import (
b64 "encoding/base64"
"fmt"
"net/url"
"strings"
"github.com/wailsapp/wails/runtime"
)
// AppConfig is the configuration structure used when creating a Wails App object
type AppConfig struct {
Width, Height int
Title string
HTML string
JS string
CSS string
Colour string
Resizable bool
// The width and height of your application in pixels
Width, Height int
// The title to put in the title bar
Title string
// The HTML your app should use. If you leave it blank, a default will be used:
// <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="IE=edge" content="IE=edge"></head><body><div id="app"></div><script type="text/javascript"></script></body></html>
HTML string
// The Javascript your app should use. Normally this should be generated by a bundler.
JS string
// The CSS your app should use. Normally this should be generated by a bundler.
CSS string
// The colour of your window. Can take "#fff", "rgb(255,255,255)", "rgba(255,255,255,1)" formats
Colour string
// Indicates whether your app should be resizable
Resizable bool
// Indicated if the devtools should be disabled
DisableInspector bool
}
@ -33,9 +51,14 @@ func (a *AppConfig) GetTitle() string {
return a.Title
}
// GetHTML returns the HTML for the app
// GetHTML returns the default HTML
func (a *AppConfig) GetHTML() string {
return "data:text/html;base64," + b64.URLEncoding.EncodeToString([]byte(a.HTML))
if len(a.HTML) > 0 {
a.HTML = url.QueryEscape(a.HTML)
a.HTML = "data:text/html," + strings.ReplaceAll(a.HTML, "+", "%20")
a.HTML = strings.ReplaceAll(a.HTML, "%3D", "=")
}
return a.HTML
}
// GetResizable returns true if the window should be resizable
@ -83,6 +106,10 @@ func (a *AppConfig) merge(in *AppConfig) error {
a.JS = in.JS
}
if in.HTML != "" {
a.HTML = in.HTML
}
if in.Width != 0 {
a.Width = in.Width
}
@ -113,6 +140,10 @@ func newConfig(userConfig *AppConfig) (*AppConfig, error) {
}
}
println("****************************************************")
fmt.Printf("%+v\n", result)
println("****************************************************")
return result, nil
}