summaryrefslogtreecommitdiffstats
path: root/src/settings.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-12-29 12:29:47 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-12-29 12:29:47 +0100
commitf74ab463d44dd0bb025b0cea466d2861576253dd (patch)
treeaa500cbe6577a6084e08f3409e406c4a7e7385e4 /src/settings.rs
parentc7b170da6d180f80e539910cccb543720fa3713c (diff)
downloadiced-f74ab463d44dd0bb025b0cea466d2861576253dd.tar.gz
iced-f74ab463d44dd0bb025b0cea466d2861576253dd.tar.bz2
iced-f74ab463d44dd0bb025b0cea466d2861576253dd.zip
Add `background_color` to `Settings`
Diffstat (limited to 'src/settings.rs')
-rw-r--r--src/settings.rs18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/settings.rs b/src/settings.rs
index 62a1a614..8da8948c 100644
--- a/src/settings.rs
+++ b/src/settings.rs
@@ -1,7 +1,8 @@
//! Configure your application.
+use crate::Color;
/// The settings of an application.
-#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
+#[derive(Debug, Clone, Copy, PartialEq)]
pub struct Settings {
/// The [`Window`] settings.
///
@@ -9,6 +10,20 @@ pub struct Settings {
///
/// [`Window`]: struct.Window.html
pub window: Window,
+
+ /// The default background [`Color`] of the application
+ ///
+ /// [`Color`]: ../struct.Color.html
+ 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.
@@ -44,6 +59,7 @@ impl From<Settings> for iced_winit::Settings {
decorations: settings.window.decorations,
platform_specific: Default::default(),
},
+ background_color: settings.background_color,
}
}
}