From b3f5c6a4be3e5ba2ef6e3f9868b8f0fcdf1d2bf9 Mon Sep 17 00:00:00 2001
From: Finn Bear <finnbearlabs@gmail.com>
Date: Tue, 26 Apr 2022 18:08:48 -0700
Subject: [PATCH] WIP.

---
 src/main.rs                                   |  6 ++--
 src/slide.rs                                  |  5 +--
 src/slide/{title.rs => s1_title.rs}           |  0
 .../{introduction.rs => s2_introduction.rs}   |  0
 src/slide/s3_complexity.rs                    | 32 +++++++++++++++++++
 5 files changed, 39 insertions(+), 4 deletions(-)
 rename src/slide/{title.rs => s1_title.rs} (100%)
 rename src/slide/{introduction.rs => s2_introduction.rs} (100%)
 create mode 100644 src/slide/s3_complexity.rs

diff --git a/src/main.rs b/src/main.rs
index 5859d1c..b05255a 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,8 +1,9 @@
 pub mod image;
 pub mod slide;
 
-use crate::slide::introduction::Introduction;
-use crate::slide::title::Title;
+use crate::slide::s1_title::Title;
+use crate::slide::s2_introduction::Introduction;
+use crate::slide::s3_complexity::Complexity;
 use crate::slide::Slide;
 use eframe::egui::style::{Margin, Widgets};
 use eframe::egui::{
@@ -45,6 +46,7 @@ impl Default for Cartoon {
             slides: vec![
                 Box::new(Title::default()) as Box<dyn Slide>,
                 Box::new(Introduction::default()),
+                Box::new(Complexity::default()),
             ],
             slide_index: 0,
         }
diff --git a/src/slide.rs b/src/slide.rs
index e3842f9..4339fee 100644
--- a/src/slide.rs
+++ b/src/slide.rs
@@ -1,8 +1,9 @@
 use eframe::egui::{Context, Ui};
 use eframe::{egui, epi};
 
-pub mod introduction;
-pub mod title;
+pub mod s1_title;
+pub mod s2_introduction;
+pub mod s3_complexity;
 
 pub trait Slide {
     fn show(&mut self, ui: &mut Ui, ctx: &Context);
diff --git a/src/slide/title.rs b/src/slide/s1_title.rs
similarity index 100%
rename from src/slide/title.rs
rename to src/slide/s1_title.rs
diff --git a/src/slide/introduction.rs b/src/slide/s2_introduction.rs
similarity index 100%
rename from src/slide/introduction.rs
rename to src/slide/s2_introduction.rs
diff --git a/src/slide/s3_complexity.rs b/src/slide/s3_complexity.rs
new file mode 100644
index 0000000..15b3a16
--- /dev/null
+++ b/src/slide/s3_complexity.rs
@@ -0,0 +1,32 @@
+use crate::egui::{Context, Ui, Window};
+use crate::{Key, Slide};
+use eframe::egui::text_edit::{CCursorRange, CursorRange, TextEditState};
+use eframe::egui::{Align, Align2, Frame, Layout, TextEdit, Vec2};
+use eframe::epaint::text::cursor::{CCursor, Cursor};
+
+#[derive(Default)]
+pub struct Complexity {}
+
+impl Slide for Complexity {
+    fn show(&mut self, ui: &mut Ui, ctx: &Context) {
+        Window::new("complexity")
+            .title_bar(false)
+            .resizable(false)
+            .frame(Frame::none())
+            .anchor(Align2::CENTER_CENTER, Vec2::ZERO)
+            .fixed_size(Vec2::new(440.0, 100.0))
+            .show(ctx, |ui| {
+                ui.vertical_centered_justified(|ui| {
+                    let mut state = TextEditState::default();
+                    state.set_ccursor_range(Some(CCursorRange::two(
+                        CCursor::new(0),
+                        CCursor::new(7),
+                    )));
+                    let text_edit =
+                        ui.text_edit_singleline(&mut "Complex Rules âž¡ Complex Results?");
+                    text_edit.request_focus();
+                    TextEdit::store_state(ctx, text_edit.id, state);
+                });
+            });
+    }
+}
-- 
GitLab