wails icon indicating copy to clipboard operation
wails copied to clipboard

Sharp Edges for Frameless App on Mac

Open Debdut opened this issue 3 years ago • 8 comments

Description

The edges of an frameless window in sharp on Mac

Screen Shot 2022-08-30 at 2 03 23 PM

To Reproduce

Use these options in your wails app

err := wails.Run(&options.App{
    Title:            "codeui",
    Width:            800,
    Height:           600,
    Assets:           assets,
    BackgroundColour: &options.RGBA{R: 27, G: 38, B: 54, A: 1},
    OnStartup:        app.startup,
    Bind: []interface{}{
        app,
    },
    Frameless: true,
    Mac: &mac.Options{
        WindowIsTranslucent:  true,
        WebviewIsTransparent: true,
    },
})

Expected behaviour

The borders must be rounded!

Screenshots

No response

Attempted Fixes

No response

System Details

System
------
OS:		MacOS
Version: 	12.5
ID:		21G72
Go Version:	go1.18.3
Platform:	darwin
Architecture:	amd64

Wails
------
Version: 	v2.0.0-beta.44.2

Dependency			Package Name	Status		Version
----------			------------	------		-------
xcode command line tools  	N/A 		Installed 	2395
npm  				N/A 		Installed 	8.5.5
*upx  				N/A 		Installed 	upx 3.96
*nsis  				N/A 		Available 	

* - Optional Dependency

Diagnosis
---------
Your system is ready for Wails development!

Additional context

No response

Debdut avatar Aug 30 '22 08:08 Debdut

On your background color, set it to transparent (A: 0). In the CSS for the body, set the border-radius for the body to the amount of curvature you want with a transparent boarder with 1 px width. It works great for my applications once built, but the dev mode doesn't render the transparency correctly.

CleanShot 2022-08-30 at 15 49 18@2x

raguay avatar Aug 30 '22 08:08 raguay

Oh I was checking the dev mode only, seems like dev mode only bug! Thanks 🙏🏻

Debdut avatar Aug 30 '22 14:08 Debdut

I'm struggling to understand why this would be true only in dev mode 🤔 Can you pinpoint why that might be?

leaanthony avatar Aug 31 '22 09:08 leaanthony

I have no idea. I've tried everything and it never works right in dev mode. But, that isn't a deal breaker.

On Wed, Aug 31, 2022 at 4:16 PM Lea Anthony @.***> wrote:

I'm struggling to understand why this would be true only in dev mode 🤔

— Reply to this email directly, view it on GitHub https://github.com/wailsapp/wails/issues/1805#issuecomment-1232684797, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAS7JRYRVYG4AY2CLHQMFKTV34PH5ANCNFSM6AAAAAAQAFIKWE . You are receiving this because you commented.Message ID: @.***>

raguay avatar Aug 31 '22 09:08 raguay

Thanks guys 🙏

@leaanthony should I close this or keep it open? or shall I create a small repo where this thing is replicated?

Debdut avatar Aug 31 '22 15:08 Debdut

Yeah, I'd like to know why!

leaanthony avatar Aug 31 '22 20:08 leaanthony

BTW: change this line:

BackgroundColour: &options.RGBA{R: 27, G: 38, B: 54, A: 1},

To:

BackgroundColour: &options.RGBA{R: 27, G: 38, B: 54, A: 0},

I believe the problem is not having the main.go file set the background to transparent. I just went through and did that on some of my projects and the dev mode started working better.

raguay avatar Sep 03 '22 01:09 raguay

That sounds insane 😂 I'll have a look this weekend...

EDIT: Looks like you were on the right path 😉 https://stackoverflow.com/questions/9962983/objective-c-rounded-corner-custom-window

leaanthony avatar Sep 03 '22 02:09 leaanthony

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 02 '22 02:11 stale[bot]