Add background_color to Settings

This commit is contained in:
Héctor Ramón Jiménez 2019-12-29 12:29:47 +01:00
parent c7b170da6d
commit f74ab463d4
6 changed files with 55 additions and 14 deletions

View file

@ -279,8 +279,12 @@ pub trait Application: Sized {
resized = false;
}
let new_mouse_cursor =
renderer.draw(&primitive, &debug.overlay(), &mut target);
let new_mouse_cursor = renderer.draw(
settings.background_color,
&primitive,
&debug.overlay(),
&mut target,
);
debug.render_finished();

View file

@ -1,4 +1,5 @@
//! Configure your application.
use crate::Color;
#[cfg(target_os = "windows")]
#[path = "windows.rs"]
@ -10,12 +11,24 @@ mod platform;
pub use platform::PlatformSpecific;
/// The settings of an application.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct Settings {
/// The [`Window`] settings
///
/// [`Window`]: struct.Window.html
pub window: Window,
/// The default background color of the application
pub background_color: Color,
}
impl Default for Settings {
fn default() -> Settings {
Settings {
window: Window::default(),
background_color: Color::WHITE,
}
}
}
/// The window settings of an application.