summaryrefslogtreecommitdiff
path: root/schist_desktop_gui/src/gui/components/text.rs
diff options
context:
space:
mode:
authorJoe Carstairs <me@joeac.net>2025-08-13 07:50:21 +0000
committerjoeac <me@joeac.net>2025-08-13 07:50:21 +0000
commitee3cd780e21260257b401c3f5cbababd9e27a15a (patch)
treeb0571649a1a1a7644dbc50183cc4c3a29966a963 /schist_desktop_gui/src/gui/components/text.rs
parent49342e8b553d5c92f1c043b3b0ce18bdf1c2cd44 (diff)
task-073
Co-authored-by: Joe Carstairs <jcarstairs@scottlogic.com> Reviewed-on: https://git.joeac.net/joeac/schist/pulls/1 Co-authored-by: Joe Carstairs <me@joeac.net> Co-committed-by: Joe Carstairs <me@joeac.net>
Diffstat (limited to 'schist_desktop_gui/src/gui/components/text.rs')
-rw-r--r--schist_desktop_gui/src/gui/components/text.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/schist_desktop_gui/src/gui/components/text.rs b/schist_desktop_gui/src/gui/components/text.rs
new file mode 100644
index 0000000..d334de3
--- /dev/null
+++ b/schist_desktop_gui/src/gui/components/text.rs
@@ -0,0 +1,22 @@
+use iced::Element;
+
+use crate::gui::components::navigation;
+
+#[derive(Clone, Debug, PartialEq)]
+pub struct Text {
+ pub content: String,
+}
+
+impl Text {
+ pub fn new(group_name: String) -> Self {
+ Self {
+ content: group_name.clone(),
+ }
+ }
+}
+
+impl<'a> Into<Element<'a, navigation::Message<Text>>> for Text {
+ fn into(self) -> Element<'a, navigation::Message<Text>> {
+ iced::widget::text(self.content.clone()).into()
+ }
+}