Skip to content

Commit

Permalink
pref: remove transparent background on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
tiny-craft committed Aug 7, 2024
1 parent a14e7e9 commit c545671
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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()
Expand All @@ -43,28 +46,29 @@ 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())
}

// 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)
Expand Down Expand Up @@ -105,20 +109,20 @@ 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,
},
WebviewIsTransparent: false,
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,
Expand Down

0 comments on commit c545671

Please sign in to comment.