Skip to content

Commit

Permalink
Update new builders for latest master
Browse files Browse the repository at this point in the history
Signed-off-by: John Nunley <[email protected]>
  • Loading branch information
notgull committed Jan 27, 2024
1 parent b542a91 commit 7066db9
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 12 deletions.
3 changes: 1 addition & 2 deletions examples/child_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ fn main() -> Result<(), impl std::error::Error> {
use winit::{
dpi::{LogicalPosition, LogicalSize, Position},
event::{ElementState, Event, KeyEvent, WindowEvent},
event_loop::{EventLoop, EventLoopWindowTarget},
raw_window_handle::HasRawWindowHandle,
event_loop::{ControlFlow, EventLoop, EventLoopWindowTarget},
window::raw_window_handle::HasRawWindowHandle,
window::{Window, WindowId},
};

Expand Down
1 change: 0 additions & 1 deletion examples/control_flow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use winit::{
event::{ElementState, Event, KeyEvent, WindowEvent},
event_loop::{ControlFlow, EventLoop},
keyboard::{Key, NamedKey},
keyboard::Key,
window::Window,
};

Expand Down
4 changes: 2 additions & 2 deletions examples/custom_cursors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use winit::{
event::{ElementState, Event, KeyEvent, WindowEvent},
event_loop::{EventLoop, EventLoopWindowTarget},
keyboard::Key,
window::{CursorIcon, CustomCursor, WindowBuilder},
window::{CursorIcon, CustomCursor, Window},
};
#[cfg(web_platform)]
use {
Expand Down Expand Up @@ -42,7 +42,7 @@ fn main() -> Result<(), impl std::error::Error> {
console_log::init_with_level(log::Level::Debug).unwrap();

let event_loop = EventLoop::new().unwrap();
let builder = WindowBuilder::new().with_title("A fantastic window!");
let builder = Window::builder().with_title("A fantastic window!");
#[cfg(web_platform)]
let builder = {
use winit::platform::web::WindowBuilderExtWebSys;
Expand Down
4 changes: 2 additions & 2 deletions examples/focus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use web_time as time;
use winit::{
event::{Event, StartCause, WindowEvent},
event_loop::EventLoop,
window::WindowBuilder,
window::Window,
};

#[path = "util/fill.rs"]
Expand All @@ -20,7 +20,7 @@ fn main() -> Result<(), impl std::error::Error> {
SimpleLogger::new().init().unwrap();
let event_loop = EventLoop::new().unwrap();

let window = WindowBuilder::new()
let window = Window::builder()
.with_title("A fantastic window!")
.with_inner_size(winit::dpi::LogicalSize::new(128.0, 128.0))
.build(&event_loop)
Expand Down
3 changes: 1 addition & 2 deletions examples/ime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ use simple_logger::SimpleLogger;
use winit::{
dpi::{PhysicalPosition, PhysicalSize},
event::{ElementState, Event, Ime, WindowEvent},
event_loop::EventLoop,
keyboard::NamedKey,
event_loop::{ControlFlow, EventLoop},
keyboard::{Key, KeyCode},
window::{ImePurpose, Window},
};

Expand Down
2 changes: 1 addition & 1 deletion examples/touch_gestures.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use simple_logger::SimpleLogger;
use winit::{
event::{Event, WindowEvent},
event_loop::{ControlFlow, EventLoop},
event_loop::EventLoop,
window::Window,
};

Expand Down
2 changes: 1 addition & 1 deletion examples/web.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use winit::{
event::{ElementState, Event, KeyEvent, WindowEvent},
event_loop::EventLoop,
keyboard::KeyCode,
keyboard::Key,
window::{Fullscreen, Window},
};

Expand Down
2 changes: 1 addition & 1 deletion src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ impl Window {
///
/// [`Window::builder().build(event_loop)`]: WindowBuilder::build
#[inline]
pub fn new<T: 'static>(event_loop: &EventLoopWindowTarget<T>) -> Result<Window, OsError> {
pub fn new(event_loop: &EventLoopWindowTarget) -> Result<Window, OsError> {
Window::builder().build(event_loop)
}

Expand Down

0 comments on commit 7066db9

Please sign in to comment.