Remove trait-specific draw logic in iced_native
This commit is contained in:
parent
3aae45c191
commit
03b3493138
71 changed files with 641 additions and 3126 deletions
|
|
@ -5,7 +5,6 @@ pub use state::State;
|
|||
|
||||
use crate::clipboard::{self, Clipboard};
|
||||
use crate::conversion;
|
||||
use crate::mouse;
|
||||
use crate::{
|
||||
Color, Command, Debug, Error, Executor, Mode, Proxy, Runtime, Settings,
|
||||
Size, Subscription,
|
||||
|
|
@ -253,9 +252,8 @@ async fn run_instance<A, E, C>(
|
|||
&mut debug,
|
||||
));
|
||||
|
||||
let mut primitive =
|
||||
user_interface.draw(&mut renderer, state.cursor_position());
|
||||
let mut mouse_interaction = mouse::Interaction::default();
|
||||
// TODO
|
||||
// let mut mouse_interaction = mouse::Interaction::default();
|
||||
|
||||
let mut events = Vec::new();
|
||||
let mut messages = Vec::new();
|
||||
|
|
@ -319,8 +317,7 @@ async fn run_instance<A, E, C>(
|
|||
}
|
||||
|
||||
debug.draw_started();
|
||||
primitive =
|
||||
user_interface.draw(&mut renderer, state.cursor_position());
|
||||
user_interface.draw(&mut renderer, state.cursor_position());
|
||||
debug.draw_finished();
|
||||
|
||||
window.request_redraw();
|
||||
|
|
@ -359,8 +356,7 @@ async fn run_instance<A, E, C>(
|
|||
debug.layout_finished();
|
||||
|
||||
debug.draw_started();
|
||||
primitive = user_interface
|
||||
.draw(&mut renderer, state.cursor_position());
|
||||
user_interface.draw(&mut renderer, state.cursor_position());
|
||||
debug.draw_finished();
|
||||
|
||||
compositor.configure_surface(
|
||||
|
|
@ -372,27 +368,16 @@ async fn run_instance<A, E, C>(
|
|||
viewport_version = current_viewport_version;
|
||||
}
|
||||
|
||||
match compositor.draw(
|
||||
match compositor.present(
|
||||
&mut renderer,
|
||||
&mut surface,
|
||||
state.viewport(),
|
||||
state.background_color(),
|
||||
&primitive,
|
||||
&debug.overlay(),
|
||||
) {
|
||||
Ok(new_mouse_interaction) => {
|
||||
Ok(()) => {
|
||||
debug.render_finished();
|
||||
|
||||
if new_mouse_interaction != mouse_interaction {
|
||||
window.set_cursor_icon(
|
||||
conversion::mouse_interaction(
|
||||
new_mouse_interaction,
|
||||
),
|
||||
);
|
||||
|
||||
mouse_interaction = new_mouse_interaction;
|
||||
}
|
||||
|
||||
// TODO: Handle animations!
|
||||
// Maybe we can use `ControlFlow::WaitUntil` for this.
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue