summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-03-22 19:35:19 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-03-22 19:35:19 +0100
commit441e9237cd1c9c9b61d9b144b5b4dafa236ace28 (patch)
tree97624f464014ee3490e346601a5414aac2c9ec34 /src
parenta2c897792ccb8f91a8479c1eca9146c439e9173b (diff)
downloadiced-441e9237cd1c9c9b61d9b144b5b4dafa236ace28.tar.gz
iced-441e9237cd1c9c9b61d9b144b5b4dafa236ace28.tar.bz2
iced-441e9237cd1c9c9b61d9b144b5b4dafa236ace28.zip
Rename `compositor::Renderer` to `Default`
Diffstat (limited to 'src')
-rw-r--r--src/application.rs4
-rw-r--r--src/lib.rs2
-rw-r--r--src/program.rs12
3 files changed, 12 insertions, 6 deletions
diff --git a/src/application.rs b/src/application.rs
index 62fe77da..9197834b 100644
--- a/src/application.rs
+++ b/src/application.rs
@@ -113,7 +113,7 @@ where
type Theme: Default;
/// The renderer of your [`Application`].
- type Renderer: text::Renderer + compositor::Renderer;
+ type Renderer: text::Renderer + compositor::Default;
/// The data needed to initialize your [`Application`].
type Flags;
@@ -215,7 +215,7 @@ where
let run = crate::shell::application::run::<
Instance<Self>,
Self::Executor,
- <Self::Renderer as compositor::Renderer>::Compositor,
+ <Self::Renderer as compositor::Default>::Compositor,
>(settings.into(), renderer_settings);
#[cfg(target_arch = "wasm32")]
diff --git a/src/lib.rs b/src/lib.rs
index 171109e7..e67b46e3 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -381,7 +381,7 @@ where
State: Default + 'static,
Message: std::fmt::Debug + Send + 'static,
Theme: Default + program::DefaultStyle + 'static,
- Renderer: graphics::compositor::Renderer + core::text::Renderer + 'static,
+ Renderer: program::Renderer + 'static,
{
program(title, update, view).run()
}
diff --git a/src/program.rs b/src/program.rs
index f5a2bc53..705e140d 100644
--- a/src/program.rs
+++ b/src/program.rs
@@ -31,6 +31,7 @@
//! }
//! ```
use crate::application::Application;
+use crate::core::text;
use crate::executor::{self, Executor};
use crate::graphics::compositor;
use crate::window;
@@ -77,7 +78,7 @@ where
State: 'static,
Message: Send + std::fmt::Debug,
Theme: Default + DefaultStyle,
- Renderer: compositor::Renderer + crate::core::text::Renderer,
+ Renderer: self::Renderer,
{
use std::marker::PhantomData;
@@ -95,7 +96,7 @@ where
where
Message: Send + std::fmt::Debug,
Theme: Default + DefaultStyle,
- Renderer: compositor::Renderer + crate::core::text::Renderer,
+ Renderer: self::Renderer,
Update: self::Update<State, Message>,
View: for<'a> self::View<'a, State, Message, Theme, Renderer>,
{
@@ -425,7 +426,7 @@ pub trait Definition: Sized {
type Theme: Default + DefaultStyle;
/// The renderer of the program.
- type Renderer: compositor::Renderer + crate::core::text::Renderer;
+ type Renderer: Renderer + crate::core::text::Renderer;
/// The executor of the program.
type Executor: Executor;
@@ -871,3 +872,8 @@ where
self(state)
}
}
+
+/// The renderer of some [`Program`].
+pub trait Renderer: text::Renderer + compositor::Default {}
+
+impl<T> Renderer for T where T: text::Renderer + compositor::Default {}