From bd184cab85bb57f715b8157e3903fa31d48d1aeb Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Thu, 16 Feb 2023 20:28:24 +1100 Subject: [PATCH] [v3] Improve plain example --- v3/examples/plain/main.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/v3/examples/plain/main.go b/v3/examples/plain/main.go index 63de5e8a1..42cf49b49 100644 --- a/v3/examples/plain/main.go +++ b/v3/examples/plain/main.go @@ -19,22 +19,26 @@ func main() { // Create window app.NewWebviewWindowWithOptions(&application.WebviewWindowOptions{ Title: "Plain Bundle", - CSS: `body { background-color: rgba(255, 255, 255, 0); } .main { color: white; margin: 20%; }`, + CSS: `body { background-color: rgba(255, 255, 255, 0); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; user-select: none; -ms-user-select: none; -webkit-user-select: none; } .main { color: white; margin: 20%; }`, Mac: application.MacWindow{ InvisibleTitleBarHeight: 50, Backdrop: application.MacBackdropTranslucent, - TitleBar: application.MacTitleBarHiddenInset, + TitleBar: application.MacTitleBarHiddenInsetUnified, }, URL: "/", Assets: application.AssetOptions{ Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusOK) - w.Write([]byte(`Plain Bundle

Plain Bundle

This is a plain bundle. It has no frontend code but this was Served by the AssetServer's Handler

`)) + w.Write([]byte(`Plain Bundle

Plain Bundle

This is a plain bundle. It has no frontend code but this was Served by the AssetServer's Handler.



Clicking this paragraph emits an event...

`)) }), }, }) + app.Events.On("clicked", func(_ *application.CustomEvent) { + println("clicked") + }) + err := app.Run() if err != nil {