wails icon indicating copy to clipboard operation
wails copied to clipboard

BackgroundColour not work in mac

Open mazhan465 opened this issue 1 year ago • 4 comments

Description

I set option:

Mac: &mac.Options{
			WindowIsTranslucent:  true,
			WebviewIsTransparent: true,
		},
BackgroundColour: options.NewRGBA(128, 0, 0, 0)

style css:

html {
    text-align: center;
}

body {
    margin: 0;
    color:rgb(255, 255, 255);
    font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
    "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
    sans-serif;
}

@font-face {
    font-family: "Nunito";
    font-style: normal;
    font-weight: 400;
    src: local(""),
    url("assets/fonts/nunito-v16-latin-regular.woff2") format("woff2");
}

#app {
    height: 100vh;
    text-align: center;
}

However what I change rgba,windows is always like picture: image options.NewRGBA(128, 0, 0, 0)can't change backcolor and can't translucent

To Reproduce

like up

Expected behaviour

window translucent

Screenshots

No response

Attempted Fixes

No response

System Details

Wails CLI v2.9.1

Available commands:

   build      Builds the application 
   dev        Runs the application in development mode 
   doctor     Diagnose your environment 
   init       Initialises a new Wails project 
   update     Update the Wails CLI 
   show       Shows various information 
   generate   Code Generation Tools 
   version    The Wails CLI version 

Flags:

  -help
        Get help on the 'wails' command.

 ♥   If Wails is useful to you or your company, please consider sponsoring the project:
https://github.com/sponsors/leaanthony
mazhan465@hb22865 hidetxt % wails doctor

                                
          Wails Doctor          
                                

                                                                                                                           
# Wails
Version | v2.9.1

# System
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
| OS           | MacOS                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Version      | 12.6                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ID           | 21G115                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Go Version   | go1.19                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Platform     | darwin                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Architecture | amd64                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| CPU          | Intel(R) Core(TM) i7-1068NG7 CPU @ 2.30GHz                                                                                                                                                                                                                                                                                                                                                                                                      |
| GPU          | Chipset Model: Intel Iris Plus Graphics Type: GPU Bus: Built-In VRAM (Dynamic, Max): 1536 MB Vendor: Intel Device ID: 0x8a53 Revision ID: 0x0007 Metal Family: Supported, Metal GPUFamily macOS 2 Displays: Color LCD: Display Type: Built-In Retina LCD Resolution: 2560 x 1600 Retina Framebuffer Depth: 30-Bit Color (ARGB2101010) Main Display: Yes Mirror: Off Online: Yes Automatically Adjust Brightness: No Connection Type: Internal   |
| Memory       | 16GB                                                                                                                                                                                                                                                                                                                                                                                                                                            |
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

# Dependencies
┌────────────────────────────────────────────────────────────────┐
| Dependency                | Package Name | Status    | Version |
| Xcode command line tools  | N/A          | Installed | 2395    |
| Nodejs                    | N/A          | Installed | 20.2.0  |
| npm                       | N/A          | Installed | 9.6.6   |
| *Xcode                    | N/A          | Available |         |
| *upx                      | N/A          | Available |         |
| *nsis                     | N/A          | Available |         |
└─────────────────── * - Optional Dependency ────────────────────┘

# Diagnosis
Optional package(s) installation details: 
  - Xcode: Available at https://apps.apple.com/us/app/xcode/id497799835
  - upx : Available at https://upx.github.io/
  - nsis : More info at https://wails.io/docs/guides/windows-installer/

 SUCCESS  Your system is ready for Wails development!

 ♥   If Wails is useful to you or your company, please consider sponsoring the project:
https://github.com/sponsors/leaanthony

Additional context

No response

mazhan465 avatar Jul 26 '24 07:07 mazhan465

I also encountered this problem. After creating the demo with the command line wails init - n myproject - t vue, change the BackgroundColor:&options RGBA {R: 255, G: 255, B: 255, A: 1}, The value of has no effect

Ph03n1xRt avatar Aug 16 '24 01:08 Ph03n1xRt

Alpha needs to be 0 for background-color CSS to show the colour of the window.

leaanthony avatar Aug 18 '24 11:08 leaanthony

Running into this as well on Sonoma 14.6.1.

Alpha needs to be 0 for background-color CSS to show the colour of the window.

Just tested this with transparent and rgba(0, 0, 0, 0) and both times the background color was white, even though I configured it black in the Go backend: BackgroundColour: options.NewRGB(0, 0, 0).

I'm quite sure setting the background color this way worked before. Maybe some kind of regression?

benjschneider avatar Aug 20 '24 19:08 benjschneider

If you believe it's a regression the best thing to do is use git bisect on the code base to find it. I'm reasonably sure this used to work.

leaanthony avatar Aug 20 '24 21:08 leaanthony