summaryrefslogtreecommitdiffstats
path: root/runtime/src/program.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-01-21 17:56:01 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-01-21 17:56:01 +0100
commit7a50e9e8fbb8d37e53a42c1dd5936b97463ead53 (patch)
treec0960018f287bcb2043a1752ae85ad0d45e00f21 /runtime/src/program.rs
parent545cc909c9f356dd733d273173694db9b8c28594 (diff)
downloadiced-7a50e9e8fbb8d37e53a42c1dd5936b97463ead53.tar.gz
iced-7a50e9e8fbb8d37e53a42c1dd5936b97463ead53.tar.bz2
iced-7a50e9e8fbb8d37e53a42c1dd5936b97463ead53.zip
Convert `Renderer::Theme` to generic `Widget` type
Diffstat (limited to 'runtime/src/program.rs')
-rw-r--r--runtime/src/program.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/runtime/src/program.rs b/runtime/src/program.rs
index 44585cc5..6c1b8f07 100644
--- a/runtime/src/program.rs
+++ b/runtime/src/program.rs
@@ -13,6 +13,9 @@ pub trait Program: Sized {
/// The graphics backend to use to draw the [`Program`].
type Renderer: Renderer + text::Renderer;
+ /// The theme used to draw the [`Program`].
+ type Theme;
+
/// The type of __messages__ your [`Program`] will produce.
type Message: std::fmt::Debug + Send;
@@ -29,5 +32,5 @@ pub trait Program: Sized {
/// Returns the widgets to display in the [`Program`].
///
/// These widgets can produce __messages__ based on user interaction.
- fn view(&self) -> Element<'_, Self::Message, Self::Renderer>;
+ fn view(&self) -> Element<'_, Self::Message, Self::Theme, Self::Renderer>;
}