Create iced_widget subcrate and re-organize the whole codebase

This commit is contained in:
Héctor Ramón Jiménez 2023-03-04 05:37:11 +01:00
parent c54409d171
commit 3a0d34c024
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
209 changed files with 1959 additions and 2183 deletions

View file

@ -1,6 +1,10 @@
use crate::application::{self, StyleSheet as _};
use crate::conversion;
use crate::{Application, Color, Debug, Point, Size, Viewport};
use crate::core;
use crate::core::{Color, Point, Size};
use crate::graphics::Viewport;
use crate::native::Debug;
use crate::Application;
use std::marker::PhantomData;
use winit::event::{Touch, WindowEvent};
@ -10,7 +14,7 @@ use winit::window::Window;
#[allow(missing_debug_implementations)]
pub struct State<A: Application>
where
<A::Renderer as crate::Renderer>::Theme: application::StyleSheet,
<A::Renderer as core::Renderer>::Theme: application::StyleSheet,
{
title: String,
scale_factor: f64,
@ -18,14 +22,14 @@ where
viewport_version: usize,
cursor_position: winit::dpi::PhysicalPosition<f64>,
modifiers: winit::event::ModifiersState,
theme: <A::Renderer as crate::Renderer>::Theme,
theme: <A::Renderer as core::Renderer>::Theme,
appearance: application::Appearance,
application: PhantomData<A>,
}
impl<A: Application> State<A>
where
<A::Renderer as crate::Renderer>::Theme: application::StyleSheet,
<A::Renderer as core::Renderer>::Theme: application::StyleSheet,
{
/// Creates a new [`State`] for the provided [`Application`] and window.
pub fn new(application: &A, window: &Window) -> Self {
@ -98,7 +102,7 @@ where
}
/// Returns the current theme of the [`State`].
pub fn theme(&self) -> &<A::Renderer as crate::Renderer>::Theme {
pub fn theme(&self) -> &<A::Renderer as core::Renderer>::Theme {
&self.theme
}