diff options
Diffstat (limited to 'winit')
| -rw-r--r-- | winit/Cargo.toml | 3 | ||||
| -rw-r--r-- | winit/src/application.rs | 12 | ||||
| -rw-r--r-- | winit/src/settings/mod.rs | 11 | 
3 files changed, 19 insertions, 7 deletions
| diff --git a/winit/Cargo.toml b/winit/Cargo.toml index 60e3f2d0..5727f8cf 100644 --- a/winit/Cargo.toml +++ b/winit/Cargo.toml @@ -6,6 +6,9 @@ edition = "2018"  description = "A winit runtime for Iced"  license = "MIT"  repository = "https://github.com/hecrj/iced" +documentation = "https://docs.rs/iced_winit" +keywords = ["gui", "ui", "graphics", "interface", "widgets"] +categories = ["gui"]  [features]  debug = [] diff --git a/winit/src/application.rs b/winit/src/application.rs index a8612b1a..da943660 100644 --- a/winit/src/application.rs +++ b/winit/src/application.rs @@ -1,5 +1,5 @@  use crate::{ -    conversion, +    container, conversion,      input::{keyboard, mouse},      renderer::{Target, Windowed},      subscription, Cache, Clipboard, Command, Container, Debug, Element, Event, @@ -18,7 +18,7 @@ pub trait Application: Sized {      /// The renderer to use to draw the [`Application`].      ///      /// [`Application`]: trait.Application.html -    type Renderer: Windowed; +    type Renderer: Windowed + container::Renderer;      /// The type of __messages__ your [`Application`] will produce.      /// @@ -81,8 +81,10 @@ pub trait Application: Sized {      /// It should probably be that last thing you call in your `main` function.      ///      /// [`Application`]: trait.Application.html -    fn run(settings: Settings) -    where +    fn run( +        settings: Settings, +        renderer_settings: <Self::Renderer as Windowed>::Settings, +    ) where          Self: 'static,      {          use winit::{ @@ -140,7 +142,7 @@ pub trait Application: Sized {          let mut resized = false;          let clipboard = Clipboard::new(&window); -        let mut renderer = Self::Renderer::new(); +        let mut renderer = Self::Renderer::new(renderer_settings);          let mut target = {              let (width, height) = to_physical(size, dpi); diff --git a/winit/src/settings/mod.rs b/winit/src/settings/mod.rs index 58e3d879..b2290b46 100644 --- a/winit/src/settings/mod.rs +++ b/winit/src/settings/mod.rs @@ -1,5 +1,4 @@  //! Configure your application. -  #[cfg(target_os = "windows")]  #[path = "windows.rs"]  mod platform; @@ -10,7 +9,7 @@ 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      /// @@ -18,6 +17,14 @@ pub struct Settings {      pub window: Window,  } +impl Default for Settings { +    fn default() -> Settings { +        Settings { +            window: Window::default(), +        } +    } +} +  /// The window settings of an application.  #[derive(Debug, Clone, Copy, PartialEq, Eq)]  pub struct Window { | 
