summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-01-05 18:11:54 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-01-05 18:11:54 +0100
commit8d6f86b317303c06a0daf1ca3ce91c29670dd674 (patch)
tree0ed859bc36eac02b249cf7767195b7474937f06e
parent5af4159848341b14f6ff9ae14a9a222d8d8b0fb8 (diff)
downloadiced-8d6f86b317303c06a0daf1ca3ce91c29670dd674.tar.gz
iced-8d6f86b317303c06a0daf1ca3ce91c29670dd674.tar.bz2
iced-8d6f86b317303c06a0daf1ca3ce91c29670dd674.zip
Remove `background` from `Settings`
-rw-r--r--native/src/renderer/windowed.rs3
-rw-r--r--src/settings.rs8
-rw-r--r--wgpu/src/renderer.rs18
-rw-r--r--winit/src/application.rs8
-rw-r--r--winit/src/settings/mod.rs6
5 files changed, 9 insertions, 34 deletions
diff --git a/native/src/renderer/windowed.rs b/native/src/renderer/windowed.rs
index 30e08cb8..c3266e6c 100644
--- a/native/src/renderer/windowed.rs
+++ b/native/src/renderer/windowed.rs
@@ -1,4 +1,4 @@
-use crate::{Color, MouseCursor};
+use crate::MouseCursor;
use raw_window_handle::HasRawWindowHandle;
@@ -21,7 +21,6 @@ pub trait Windowed: super::Renderer + Sized {
/// top of the GUI on most scenarios.
fn draw<T: AsRef<str>>(
&mut self,
- clear_color: Color,
output: &Self::Output,
overlay: &[T],
target: &mut Self::Target,
diff --git a/src/settings.rs b/src/settings.rs
index b01e6fc8..b725ef9f 100644
--- a/src/settings.rs
+++ b/src/settings.rs
@@ -1,5 +1,4 @@
//! Configure your application.
-use crate::Color;
/// The settings of an application.
#[derive(Debug, Clone, Copy, PartialEq)]
@@ -11,11 +10,6 @@ pub struct Settings {
/// [`Window`]: struct.Window.html
pub window: Window,
- /// The default background [`Color`] of the application
- ///
- /// [`Color`]: ../struct.Color.html
- pub background: Color,
-
// TODO: Add `name` for web compatibility
pub default_font: Option<&'static [u8]>,
}
@@ -24,7 +18,6 @@ impl Default for Settings {
fn default() -> Settings {
Settings {
window: Window::default(),
- background: Color::WHITE,
default_font: None,
}
}
@@ -63,7 +56,6 @@ impl From<Settings> for iced_winit::Settings {
decorations: settings.window.decorations,
platform_specific: Default::default(),
},
- background: settings.background,
}
}
}
diff --git a/wgpu/src/renderer.rs b/wgpu/src/renderer.rs
index 7f0f0b89..8f0b2020 100644
--- a/wgpu/src/renderer.rs
+++ b/wgpu/src/renderer.rs
@@ -80,7 +80,6 @@ impl Renderer {
fn draw<T: AsRef<str>>(
&mut self,
- clear_color: Color,
(primitive, mouse_cursor): &(Primitive, MouseCursor),
overlay: &[T],
target: &mut Target,
@@ -102,15 +101,11 @@ impl Renderer {
resolve_target: None,
load_op: wgpu::LoadOp::Clear,
store_op: wgpu::StoreOp::Store,
- clear_color: {
- let [r, g, b, a] = clear_color.into_linear();
-
- wgpu::Color {
- r: f64::from(r),
- g: f64::from(g),
- b: f64::from(b),
- a: f64::from(a),
- }
+ clear_color: wgpu::Color {
+ r: 1.0,
+ g: 1.0,
+ b: 1.0,
+ a: 1.0,
},
}],
depth_stencil_attachment: None,
@@ -443,12 +438,11 @@ impl Windowed for Renderer {
fn draw<T: AsRef<str>>(
&mut self,
- clear_color: Color,
output: &Self::Output,
overlay: &[T],
target: &mut Target,
) -> MouseCursor {
- self.draw(clear_color, output, overlay, target)
+ self.draw(output, overlay, target)
}
}
diff --git a/winit/src/application.rs b/winit/src/application.rs
index d16c209c..da943660 100644
--- a/winit/src/application.rs
+++ b/winit/src/application.rs
@@ -281,12 +281,8 @@ pub trait Application: Sized {
resized = false;
}
- let new_mouse_cursor = renderer.draw(
- settings.background,
- &primitive,
- &debug.overlay(),
- &mut target,
- );
+ let new_mouse_cursor =
+ renderer.draw(&primitive, &debug.overlay(), &mut target);
debug.render_finished();
diff --git a/winit/src/settings/mod.rs b/winit/src/settings/mod.rs
index 0384df32..b2290b46 100644
--- a/winit/src/settings/mod.rs
+++ b/winit/src/settings/mod.rs
@@ -1,6 +1,4 @@
//! Configure your application.
-use crate::Color;
-
#[cfg(target_os = "windows")]
#[path = "windows.rs"]
mod platform;
@@ -17,16 +15,12 @@ pub struct Settings {
///
/// [`Window`]: struct.Window.html
pub window: Window,
-
- /// The default background color of the application
- pub background: Color,
}
impl Default for Settings {
fn default() -> Settings {
Settings {
window: Window::default(),
- background: Color::WHITE,
}
}
}