pref: remove transparent background on Windows

This commit is contained in:
Lykin 2024-08-07 23:12:01 +08:00
parent a14e7e947e
commit c54567115e
1 changed files with 12 additions and 8 deletions

20
main.go
View File

@ -3,6 +3,7 @@ package main
import (
"context"
"embed"
"fmt"
"github.com/wailsapp/wails/v2"
"github.com/wailsapp/wails/v2/pkg/menu"
"github.com/wailsapp/wails/v2/pkg/options"
@ -25,6 +26,8 @@ var icon []byte
var version = "0.0.0"
var gaMeasurementID, gaSecretKey string
const appName = "Tiny RDM"
func main() {
// Create an instance of the app structure
sysSvc := services.System()
@ -43,8 +46,9 @@ func main() {
}
// menu
isMacOS := runtime.GOOS == "darwin"
appMenu := menu.NewMenu()
if runtime.GOOS == "darwin" {
if isMacOS {
appMenu.Append(menu.AppMenu())
appMenu.Append(menu.EditMenu())
appMenu.Append(menu.WindowMenu())
@ -52,19 +56,19 @@ func main() {
// Create application with options
err := wails.Run(&options.App{
Title: "Tiny RDM",
Title: appName,
Width: windowWidth,
Height: windowHeight,
MinWidth: consts.MIN_WINDOW_WIDTH,
MinHeight: consts.MIN_WINDOW_HEIGHT,
WindowStartState: windowStartState,
Frameless: runtime.GOOS != "darwin",
Frameless: !isMacOS,
Menu: appMenu,
EnableDefaultContextMenu: true,
AssetServer: &assetserver.Options{
Assets: assets,
},
BackgroundColour: options.NewRGBA(27, 38, 54, 0),
BackgroundColour: options.NewRGBA(255, 255, 255, 0),
StartHidden: true,
OnStartup: func(ctx context.Context) {
sysSvc.Start(ctx, version)
@ -105,7 +109,7 @@ func main() {
Mac: &mac.Options{
TitleBar: mac.TitleBarHiddenInset(),
About: &mac.AboutInfo{
Title: "Tiny RDM " + version,
Title: fmt.Sprintf("%s %s", appName, version),
Message: "A modern lightweight cross-platform Redis desktop client.\n\nCopyright © 2024",
Icon: icon,
},
@ -113,12 +117,12 @@ func main() {
WindowIsTranslucent: false,
},
Windows: &windows.Options{
WebviewIsTransparent: true,
WindowIsTranslucent: true,
WebviewIsTransparent: false,
WindowIsTranslucent: false,
DisableFramelessWindowDecorations: false,
},
Linux: &linux.Options{
ProgramName: "Tiny RDM",
ProgramName: appName,
Icon: icon,
WebviewGpuPolicy: linux.WebviewGpuPolicyOnDemand,
WindowIsTranslucent: true,