Removed glutin MW support and reverted glutin changes back to Iced master since it's being axed as we speak.
This commit is contained in:
parent
51296572c0
commit
e36daa6f93
15 changed files with 130 additions and 1376 deletions
|
|
@ -734,7 +734,7 @@ pub fn run_command<A, E>(
|
|||
clipboard.write(contents);
|
||||
}
|
||||
},
|
||||
command::Action::Window(_id, action) => match action {
|
||||
command::Action::Window(_, action) => match action {
|
||||
window::Action::Close => {
|
||||
*should_exit = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
//! Create interactive, native cross-platform applications.
|
||||
//! Create interactive, native cross-platform applications for WGPU.
|
||||
mod state;
|
||||
|
||||
pub use state::State;
|
||||
|
|
@ -31,17 +31,14 @@ pub use crate::Profiler;
|
|||
#[cfg(feature = "trace")]
|
||||
use tracing::{info_span, instrument::Instrument};
|
||||
|
||||
/// TODO(derezzedex)
|
||||
// This is the an wrapper around the `Application::Message` associate type
|
||||
// to allows the `shell` to create internal messages, while still having
|
||||
// the current user specified custom messages.
|
||||
/// This is a wrapper around the `Application::Message` associate type
|
||||
/// to allows the `shell` to create internal messages, while still having
|
||||
/// the current user specified custom messages.
|
||||
#[derive(Debug)]
|
||||
pub enum Event<Message> {
|
||||
/// An [`Application`] generated message
|
||||
Application(Message),
|
||||
/// TODO(derezzedex)
|
||||
// Create a wrapper variant of `window::Event` type instead
|
||||
// (maybe we should also allow users to listen/react to those internal messages?)
|
||||
/// A message which spawns a new window.
|
||||
NewWindow {
|
||||
/// The [window::Id] of the newly spawned [`Window`].
|
||||
id: window::Id,
|
||||
|
|
@ -50,9 +47,9 @@ pub enum Event<Message> {
|
|||
/// The title of the newly spawned [`Window`].
|
||||
title: String,
|
||||
},
|
||||
/// TODO(derezzedex)
|
||||
/// Close a window.
|
||||
CloseWindow(window::Id),
|
||||
/// TODO(derezzedex)
|
||||
/// A message for when the window has finished being created.
|
||||
WindowCreated(window::Id, winit::window::Window),
|
||||
}
|
||||
|
||||
|
|
@ -90,7 +87,7 @@ where
|
|||
/// background by shells.
|
||||
fn update(&mut self, message: Self::Message) -> Command<Self::Message>;
|
||||
|
||||
/// Returns the widgets to display in the [`Program`].
|
||||
/// Returns the widgets to display for the `window` in the [`Program`].
|
||||
///
|
||||
/// These widgets can produce __messages__ based on user interaction.
|
||||
fn view(
|
||||
|
|
@ -108,7 +105,7 @@ where
|
|||
/// load state from a file, perform an initial HTTP request, etc.
|
||||
fn new(flags: Self::Flags) -> (Self, Command<Self::Message>);
|
||||
|
||||
/// Returns the current title of the current [`Application`] window.
|
||||
/// Returns the current title of each [`Application`] window.
|
||||
///
|
||||
/// This title can be dynamic! The runtime will automatically update the
|
||||
/// title of your application when necessary.
|
||||
|
|
@ -137,7 +134,7 @@ where
|
|||
Subscription::none()
|
||||
}
|
||||
|
||||
/// Returns the scale factor of the [`Application`].
|
||||
/// Returns the scale factor of the window of the [`Application`].
|
||||
///
|
||||
/// It can be used to dynamically control the size of the UI at runtime
|
||||
/// (i.e. zooming).
|
||||
|
|
@ -1142,7 +1139,7 @@ pub fn run_command<A, E>(
|
|||
}
|
||||
}
|
||||
|
||||
/// TODO(derezzedex)
|
||||
/// Build the user interfaces for every window.
|
||||
pub fn build_user_interfaces<'a, A>(
|
||||
application: &'a A,
|
||||
renderer: &mut A::Renderer,
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ use std::marker::PhantomData;
|
|||
use winit::event::{Touch, WindowEvent};
|
||||
use winit::window::Window;
|
||||
|
||||
/// The state of a windowed [`Application`].
|
||||
/// The state of a multi-windowed [`Application`].
|
||||
#[allow(missing_debug_implementations)]
|
||||
pub struct State<A: Application>
|
||||
where
|
||||
|
|
@ -29,7 +29,7 @@ impl<A: Application> State<A>
|
|||
where
|
||||
<A::Renderer as crate::Renderer>::Theme: application::StyleSheet,
|
||||
{
|
||||
/// Creates a new [`State`] for the provided [`Application`]'s window.
|
||||
/// Creates a new [`State`] for the provided [`Application`]'s `window`.
|
||||
pub fn new(
|
||||
application: &A,
|
||||
window_id: window::Id,
|
||||
|
|
@ -116,8 +116,7 @@ where
|
|||
self.appearance.text_color
|
||||
}
|
||||
|
||||
/// Processes the provided window event and updates the [`State`]
|
||||
/// accordingly.
|
||||
/// Processes the provided window event and updates the [`State`] accordingly.
|
||||
pub fn update(
|
||||
&mut self,
|
||||
window: &Window,
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ pub struct Profiler {
|
|||
impl Profiler {
|
||||
/// Initializes the [`Profiler`].
|
||||
pub fn init() -> Self {
|
||||
log::info!("Capturing trace..");
|
||||
// Registry stores the spans & generates unique span IDs
|
||||
let subscriber = Registry::default();
|
||||
|
||||
|
|
|
|||
|
|
@ -179,9 +179,9 @@ impl Window {
|
|||
{
|
||||
use winit::platform::windows::WindowBuilderExtWindows;
|
||||
|
||||
// if let Some(parent) = self.platform_specific.parent {
|
||||
// window_builder = window_builder.with_parent_window(parent);
|
||||
// }
|
||||
if let Some(parent) = self.platform_specific.parent {
|
||||
window_builder = window_builder.with_parent_window(parent);
|
||||
}
|
||||
|
||||
window_builder = window_builder
|
||||
.with_drag_and_drop(self.platform_specific.drag_and_drop);
|
||||
|
|
@ -227,7 +227,7 @@ impl From<iced_native::window::Settings> for Window {
|
|||
fn from(settings: iced_native::window::Settings) -> Self {
|
||||
Self {
|
||||
size: settings.size,
|
||||
position: Position::from(settings.position),
|
||||
position: settings.position,
|
||||
min_size: settings.min_size,
|
||||
max_size: settings.max_size,
|
||||
visible: settings.visible,
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub struct PlatformSpecific {
|
||||
/// Parent window
|
||||
// pub parent: Option<winit::platform::windows::HWND>,
|
||||
pub parent: Option<winit::platform::windows::HWND>,
|
||||
|
||||
/// Drag and drop support
|
||||
pub drag_and_drop: bool,
|
||||
|
|
@ -13,7 +13,7 @@ pub struct PlatformSpecific {
|
|||
impl Default for PlatformSpecific {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
// parent: None,
|
||||
parent: None,
|
||||
drag_and_drop: true,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue