mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Add shell.background-color.rgba to prefs (#30488)
* Add shell.transparent-background.enabled to prefs * Rename config to background_color * Rename to background-color and.rgba add PrefValue::Array variant
This commit is contained in:
parent
ffac882f8f
commit
38a325cc1c
8 changed files with 108 additions and 37 deletions
|
@ -1873,7 +1873,7 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
|
|||
self.assert_gl_framebuffer_complete();
|
||||
}
|
||||
|
||||
// Make the viewport white.
|
||||
// Set the viewport background based on prefs.
|
||||
let viewport = self.embedder_coordinates.get_flipped_viewport();
|
||||
gl.scissor(
|
||||
viewport.origin.x,
|
||||
|
@ -1881,7 +1881,14 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
|
|||
viewport.size.width,
|
||||
viewport.size.height,
|
||||
);
|
||||
gl.clear_color(1.0, 1.0, 1.0, 1.0);
|
||||
|
||||
let color = servo_config::pref!(shell.background_color.rgba);
|
||||
gl.clear_color(
|
||||
color[0] as f32,
|
||||
color[1] as f32,
|
||||
color[2] as f32,
|
||||
color[3] as f32,
|
||||
);
|
||||
gl.enable(gleam::gl::SCISSOR_TEST);
|
||||
gl.clear(gleam::gl::COLOR_BUFFER_BIT);
|
||||
gl.disable(gleam::gl::SCISSOR_TEST);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue