From 96d304338717d50a7365b431ccb357942b414ea7 Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Sun, 21 Jan 2024 21:32:06 +0100 Subject: set darktheme and fix text overflow in canvas --- src/main.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index a00d137..5565edb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -37,6 +37,7 @@ impl Application for Graph { &pane, Pane::new(PaneKind::GraphPane), ); + ( Graph { graph_canvas: GraphCanvas::new(), @@ -73,6 +74,7 @@ impl Application for Graph { self.graph_canvas.clear(); } Message::Resized(pane_grid::ResizeEvent { split, ratio }) => { + self.graph_canvas.clear(); self.panes.resize(&split, ratio); } } @@ -95,7 +97,7 @@ impl Application for Graph { text_input("f(x) = x^2", f) .on_input(move |s| Message::InputChanged(s, i)) .on_submit(Message::UpdateFunction(i)), - button("R").on_press(Message::RemoveFunction(i)) + button("-").on_press(Message::RemoveFunction(i)) ].padding(5) ); } @@ -126,4 +128,8 @@ impl Application for Graph { .padding(10) .into() } + + fn theme(&self) -> Self::Theme { + Theme::Dark + } } -- cgit v1.2.3-70-g09d2