mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 14:45:49 +01:00
Fix background color alpha on linux (#4722)
* Fix background color alpha on linux * Add CHANGELOG entry * Apply suggestion from @coderabbitai[bot] Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: Lea Anthony <lea.anthony@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
parent
c36618c2ac
commit
b652e61e2c
2 changed files with 2 additions and 1 deletions
|
|
@ -24,6 +24,8 @@ After processing, the content will be moved to the main changelog and this file
|
|||
## Fixed
|
||||
<!-- Bug fixes -->
|
||||
|
||||
- Resolve alpha value being ignored in `application.WebviewWindowOptions.BackgroundColour` on Linux ([#4722](https://github.com/wailsapp/wails/pull/4722), @BradHacker)
|
||||
|
||||
## Deprecated
|
||||
<!-- Soon-to-be removed features -->
|
||||
|
||||
|
|
|
|||
|
|
@ -1190,7 +1190,6 @@ func (w *linuxWebviewWindow) setBackgroundColour(colour RGBA) {
|
|||
rgba := C.GdkRGBA{C.double(colour.Red) / 255.0, C.double(colour.Green) / 255.0, C.double(colour.Blue) / 255.0, C.double(colour.Alpha) / 255.0}
|
||||
C.webkit_web_view_set_background_color((*C.WebKitWebView)(w.webview), &rgba)
|
||||
|
||||
colour.Alpha = 255
|
||||
cssStr := C.CString(fmt.Sprintf("#webview-box {background-color: rgba(%d, %d, %d, %1.1f);}", colour.Red, colour.Green, colour.Blue, float32(colour.Alpha)/255.0))
|
||||
provider := C.gtk_css_provider_new()
|
||||
C.gtk_style_context_add_provider(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue