New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add shell.background-color.rgba to prefs #30488
Conversation
I really think should allow setting a background color (which can be transparent) as that is what all other WebView APIs. do. |
Alright, how about changing it to |
That seems sensible. Thanks. |
resources/prefs.json
Outdated
"shell.background-color.alpha": 1.0, | ||
"shell.background-color.blue": 1.0, | ||
"shell.background-color.green": 1.0, | ||
"shell.background-color.red": 1.0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to represent this as an array like:
"shell.background-color.red": [1.0, 1.0, 1.0, 1.0],
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'll need to add new variant like serde's Value::Array
to PrefValue
. I can try to add this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mrobinson I added new variant PrefValue
and make sure other crates can handle it well.
It probably could add a macro to handle From
trait between array and this vraint.
But I suppose it's better to wait until there's more configs that require array.
So we can implement more ergonomic one.
Nice. |
With surfman#260, it's possible for all platforms to display transparent background now. This could let users to make more native-like interface as they wish. Right now, servo will still make viewport background white. And I hope it can add a config to toggle this to transparent background.
Based on feedbacks on zulip, this PR adds
shell.background-color.rgba
to prefs with the resource fileprefs.json
set to[1.0, 1.0, 1.0, 1.0]
by default../mach build -d
does not report any errors./mach test-tidy
does not report any errors